Microsoft Office Tutorials and References
In Depth Information
Inside Out
The FormulaLocal Property and Local Settings
The FormulaLocal property returns or sets a formula in the language specified in the active
Windows user’s regional settings. For example, if a user types the formula =SOMME(B3:B15)
into an input box ( SOMME is the French version of SUM ), you can assign the formula to cell
B16 on the first worksheet in your workbook using the following statement:
Range(B16).FormulaLocal = InputBox("Enter a formula.")
Table 6-2. Cell Error Values
Error Value
Error 2015
Error 2007
Error 2042
Error 2029
Error 2000
Error 2036
Error 2023
Error 2015
Intersect Method
The Intersect method compares two or more ranges to determine if they overlap or share any
common cells. Figure 6-5 shows one range bounded at B3:E6 and a second range bounded at
D5:G8. The intersection of the two would be the range D5:E6 as illustrated in the following
Sub DisplayIntersection()
Range("B3:E6").BorderAround Color:=vbBlack, Weight:=xlThick
Set rge1 = Selection
Range("D5:E8").BorderAround Color:=vbYellow, Weight:=xlThick
Set rge2 = Selection
Set myRange = Application.Intersect(rge1, rge2)
Selection.Interior.Color = vbBlue
End Sub
Search JabSto ::

Custom Search