Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Selection based on values in a cell

Cell A1 contains an integer value
Cell B1 contains a (larger) integer value
The cursor is placed at cell C1
Can anyone tell me what the code would be to select a
range in row 1 which starts at the column value in A1 and
ends at the column value in B1 and then returns the cursor
to C1?
Help would be much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selection based on values in a cell

Sub Tester1()
Range(Rows(Range("A1")), Rows(Range("B1"))).Select
Selection.Interior.ColorIndex = 4
Range("C1").Select
End Sub

Not sure what the point of selecting the rows if if you then move the
selection back to C1.

To maintain the selection and still have the cursor in C1, both
Sub Tester2()
Union(Range(Rows(Range("A1")), _
Rows(Range("B1"))), Range("C1")).Select
Range("C1").Activate
End Sub

--
Regards,
Tom Ogilvy


"Stewart" wrote in message
...
Cell A1 contains an integer value
Cell B1 contains a (larger) integer value
The cursor is placed at cell C1
Can anyone tell me what the code would be to select a
range in row 1 which starts at the column value in A1 and
ends at the column value in B1 and then returns the cursor
to C1?
Help would be much appreciated.



Reply
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
Creating values based on selection from drop down box ck Excel Discussion (Misc queries) 0 March 12th 10 01:07 AM
Formatting cell based upon values w/in a selection Carissa New Users to Excel 1 December 17th 08 07:04 PM
Calculating values based on selection from a drop-down list in Exc Razzamatazz Excel Worksheet Functions 3 July 12th 08 05:11 PM
List box change values based on selection Cam Excel Discussion (Misc queries) 0 March 17th 08 01:38 PM
Excel - Sum of Values based on adjacent list selection Beki Goodwin New Users to Excel 1 April 24th 07 11:58 PM


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

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

About Us

"It's about Microsoft Excel"