ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   code to go to start of line (https://www.excelbanter.com/excel-programming/373096-code-go-start-line.html)

BorisS

code to go to start of line
 
I need code to go to the first cell of the given row I am in, without knowing
how many columns over I am when I run the macro. In other words, a user is
going to be told to place their cursor on a line, and then run a macro. The
macro will rely on getting to the beginning of the line, then going over to
the 33rd column.

Alternative (and maybe even better) would be to be able to say that I want
the activecell to be the 33rd column (column AH), on the line from which the
macro was launched.

Either or both of these would be greatly appreciated. Thx.
--
Boris

Tim Williams

code to go to start of line
 
activesheet.cells(activecell.row,1).select '1st cell in row

activesheet.cells(activecell.row,33).select 'col 33

Tim


"BorisS" wrote in message
...
I need code to go to the first cell of the given row I am in, without
knowing
how many columns over I am when I run the macro. In other words, a user
is
going to be told to place their cursor on a line, and then run a macro.
The
macro will rely on getting to the beginning of the line, then going over
to
the 33rd column.

Alternative (and maybe even better) would be to be able to say that I want
the activecell to be the 33rd column (column AH), on the line from which
the
macro was launched.

Either or both of these would be greatly appreciated. Thx.
--
Boris





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

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