Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get a Method Range of object global failed error on the following line
of code: If Range("C[" & rowtop & "]").Value = Range("A1").Value Then On that particular line the variable (rowtop) should be 3 since the ActiveCell.Row is less than 9. Sub aaaData_Sort() Dim rowtop As Integer Dim row1 As Integer Dim row5 As Integer If ActiveCell.Row 9 Then rowtop = 3 row1 = 4 row5 = 8 End If If Range("C[" & rowtop & "]").Value = Range("A1").Value Then GoTo Continue1 End If If Range("C[" & rowtop & "]").Value "" Then Range("A[" & row1 & "]:C[" & row2 & "]").Select Selection.Sort Key1:=Range("A[" & row1 & "]"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If Continue1: |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable within a formula | Excel Worksheet Functions | |||
Using a variable in a formula | Excel Discussion (Misc queries) | |||
Using a variable in a VBA formula | Excel Discussion (Misc queries) | |||
Using a variable in formula | Excel Programming | |||
Formula Variable | Excel Programming |