ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Cells (https://www.excelbanter.com/excel-programming/271479-selecting-cells.html)

m[_3_]

Selecting Cells
 
I need to select at the cells between the active cell and the
count cell in a do loop,
have written as follows:
Sub sort()
Range("A100").Select
Do While ActiveCell = ActiveCell.Offset(-1, 0)
If ActiveCell = ActiveCell.Offset(-1, 0) Then ActiveCell.Offset(1, 6) =
ActiveCell.Offset(1, 6) + 1 And ActiveCell.Offset(-1, 0).Select
Loop
Counter = ActiveCell.Offset(1, 6).Value + 1
Do Until Selection.Offset(Counter, 0) = aaaa
If (Selection.Offset(Counter, 0)) = ActiveCell Then DON'T KNOW WHAT TO WRITE
HERE
With Selection.Offset(Counter, 0)
End With
End If
Counter = Counter + 1
Loop
End Sub

can anyone HELP

Thanks Mark



Don Guillett[_4_]

Selecting Cells
 
No need to select. This does a100:alast cell in col A

sub dontcallitSORT()
for each c in range("a100:a" & cells(65536,1).end(xlup).row)
If c = c.Offset(-1, 0) Then c.Offset(1, 6) = _
c.Offset(1, 6) + 1 + c.Offset(-1, 0) 'not sure this part is what
you want
next
end sub

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"m" wrote in message
...
I need to select at the cells between the active cell and the
count cell in a do loop,
have written as follows:
Sub sort()
Range("A100").Select
Do While ActiveCell = ActiveCell.Offset(-1, 0)
If ActiveCell = ActiveCell.Offset(-1, 0) Then ActiveCell.Offset(1, 6) =
ActiveCell.Offset(1, 6) + 1 And ActiveCell.Offset(-1, 0).Select
Loop
Counter = ActiveCell.Offset(1, 6).Value + 1
Do Until Selection.Offset(Counter, 0) = aaaa
If (Selection.Offset(Counter, 0)) = ActiveCell Then DON'T KNOW WHAT TO

WRITE
HERE
With Selection.Offset(Counter, 0)
End With
End If
Counter = Counter + 1
Loop
End Sub

can anyone HELP

Thanks Mark






All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com