View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default use of activecell

So if you're wanting to select the cell again:

Cells(rw, cl).Select


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"inquirer" wrote in message
...
No, it gets superceded by Range("c2").Select

"Rob van Gelder" wrote in message
...
Isn't the cell in error already selected?

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"inquirer" wrote in message
...
I have a program which reads data into columns C-H. The number of rows
varies from case to case.
I want the user to select a starting cell from the dat in column C
I have the following which seesms clumsy but works:

rw = ActiveCell.Row
cl = ActiveCell.Column
Range("c2").Select
lastrow = Range(Selection, Selection.End(xlDown)).Cells.Count + 1
If rw < 2 Or rw lastrow - 1 Then
MsgBox "Start cell outside data range"
Exit Sub
End If
If cl < 3 Then
MsgBox " Start cell in wrong column"
Exit Sub
End If

Before exiting the sub with an error, I would like to reset the active

cell
to the (incorrect) cell the user selected.

Can someone tell me how to do this please? Or suggest a better way?
Thanks
Chris