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: 2
Default Verify starting cell for macro

I have written a macro which extracts data from cells in the same row and
sets it out on a new sheet created in the same workbook. The macro
dimensions variables (approx 100 of them) which are given values by using
the expression "NameofVariable=ActiveCell.Offset(0,-x) where x is the number
of colums before the cell selected by cursor before running the macro.
In the present case the required starting cell must be within the range
column EW row 6 (+) where the rows go on increasing ( initially 20 and
increasing by about 6 per month).
My difficulty is (and hence the present question) How do I write an error
trap at the beginning of the macro to check that the starting cell selected
falls within the required range? If it doesn't then message "Do you mean
xxxx " where xxxx is the contents of col EW in the same row.

Have been running in circles on this and would now appreciate being pointed
in the right direction.

Thanks in anticipation

Don Cameron


 
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
Macro - Return to starting cell sony654 Excel Worksheet Functions 8 February 26th 06 08:55 PM
Returning Macro to Starting Cell sony654 Excel Worksheet Functions 3 February 25th 06 12:02 PM
Returning Macro to Starting Cell sony654 Excel Worksheet Functions 4 February 25th 06 12:46 AM
Getting macro to copy to starting cell sony654 Excel Worksheet Functions 3 February 4th 06 07:16 PM
Starting a macro by changing a cell in a column. Turnecm Excel Programming 1 July 19th 03 03:13 PM


All times are GMT +1. The time now is 08:56 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"