#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default select cell

My objective is : select a range of cells from A1 to {cell}. {cell} is a
variable that my cursor stays.
For example, if my cursor stop at cell h13, the macro will select a1..h13.
If my cursor stop at cell h26, the macro will select a1..h26.

Is it possible to have this kind of coding?

Range("A1:{cell}").Select
How can I substitute the selected cell's name into {cell}?
Please advise

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select cell


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/14/2006 by Dave
'

'
Range("A1:H13").Select
End Sub

or

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/14/2006 by Dave
'

Range("A1").Select

Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
End Sub


this starts at A1 and Ends at your last cell


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=522331

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default select cell

do you mean the activecell, the cell the cursor is in?

Range("A1:" & ActiveCell.Address).Select

--


Gary


"Anna" wrote in message
...
My objective is : select a range of cells from A1 to {cell}. {cell} is a
variable that my cursor stays.
For example, if my cursor stop at cell h13, the macro will select a1..h13.
If my cursor stop at cell h26, the macro will select a1..h26.

Is it possible to have this kind of coding?

Range("A1:{cell}").Select
How can I substitute the selected cell's name into {cell}?
Please advise



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default select cell

Range("A1",ActiveCell).Select

--
Regards,
Tom Ogilvy



"Anna" wrote in message
...
My objective is : select a range of cells from A1 to {cell}. {cell} is a
variable that my cursor stays.
For example, if my cursor stop at cell h13, the macro will select a1..h13.
If my cursor stop at cell h26, the macro will select a1..h26.

Is it possible to have this kind of coding?

Range("A1:{cell}").Select
How can I substitute the selected cell's name into {cell}?
Please advise



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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
How to point to (select) a cell to the left from a cell where I enter the = equal sign? Dmitry Excel Discussion (Misc queries) 4 June 30th 06 06:49 AM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM
Select First Active Cell if the cell is in a pivot table Don Excel Programming 0 June 30th 04 01:53 PM


All times are GMT +1. The time now is 08:48 AM.

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"