ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select cell (https://www.excelbanter.com/excel-programming/356004-select-cell.html)

Anna

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


davesexcel[_67_]

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


Gary Keramidas

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




Tom Ogilvy

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





All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com