LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default use of activecell

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using activecell in vlookup csdjj Excel Discussion (Misc queries) 2 June 25th 09 11:31 PM
Set ActiveCell at the first column of the same row... Dave Excel Discussion (Misc queries) 2 April 16th 09 08:03 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Activecell value Shamsul Islam Excel Programming 5 April 30th 04 10:10 PM
how to set activecell? ljb[_2_] Excel Programming 2 November 18th 03 04:49 PM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"