ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   activecell column to a given range (https://www.excelbanter.com/excel-programming/369309-activecell-column-given-range.html)

Peter Morris

activecell column to a given range
 
I've recently started doing some Excel programming after a gap
of about 4 years, I find I've forgotten a lot.

What's the syntax for this? The activecell is in a given column.
I want to go to the same column, but a different row, ie a particular
row in a named range "Column_Headings"

to put it another way, what I want to go is go to the column
heading of whichever column I'm in at the moment.

TIA



Dave Peterson

activecell column to a given range
 
Activesheet.cells(1,activecell.column).Select
or
activecell.entirecolumn.cells(1).Select

Peter Morris wrote:

I've recently started doing some Excel programming after a gap
of about 4 years, I find I've forgotten a lot.

What's the syntax for this? The activecell is in a given column.
I want to go to the same column, but a different row, ie a particular
row in a named range "Column_Headings"

to put it another way, what I want to go is go to the column
heading of whichever column I'm in at the moment.

TIA


--

Dave Peterson

Peter Morris

activecell column to a given range
 

Peter Morris wrote:

I've recently started doing some Excel programming after a gap
of about 4 years, I find I've forgotten a lot.

What's the syntax for this? The activecell is in a given column.
I want to go to the same column, but a different row, ie a particular
row in a named range "Column_Headings"

to put it another way, what I want to go is go to the column
heading of whichever column I'm in at the moment.

TIA



"Dave Peterson" wrote in message
...
Activesheet.cells(1,activecell.column).Select
or
activecell.entirecolumn.cells(1).Select



No, the cell isn't neccesarily going to be in row 1.
Its going to be above a particular column of figures
but there may be stuff above it.



Dave Peterson

activecell column to a given range
 
Do you know the row number to go to?

Activesheet.cells(###,activecell.column).Select

if you do, change ### to that row number.

Peter Morris wrote:

Peter Morris wrote:

I've recently started doing some Excel programming after a gap
of about 4 years, I find I've forgotten a lot.

What's the syntax for this? The activecell is in a given column.
I want to go to the same column, but a different row, ie a particular
row in a named range "Column_Headings"

to put it another way, what I want to go is go to the column
heading of whichever column I'm in at the moment.

TIA


"Dave Peterson" wrote in message
...
Activesheet.cells(1,activecell.column).Select
or
activecell.entirecolumn.cells(1).Select


No, the cell isn't neccesarily going to be in row 1.
Its going to be above a particular column of figures
but there may be stuff above it.


--

Dave Peterson

Peter Morris

activecell column to a given range
 

"Dave Peterson" wrote in message
...
Do you know the row number to go to?



No, that's the point.

To be precise, I know the row number NOW, but
as I develop my code Imight move the cells to a different
location. I don't waant tohard code a specific row
number.

Cells in the row are a named range "column_headers"
I want the current column within that range. Or an
alternative way to do this.



Dave Peterson

activecell column to a given range
 
Ahhhh. I missed that part.

with activesheet
.cells(.range("column_headers").row,activecell.col umn).Select
end with




Peter Morris wrote:

"Dave Peterson" wrote in message
...
Do you know the row number to go to?


No, that's the point.

To be precise, I know the row number NOW, but
as I develop my code Imight move the cells to a different
location. I don't waant tohard code a specific row
number.

Cells in the row are a named range "column_headers"
I want the current column within that range. Or an
alternative way to do this.


--

Dave Peterson

Dave Peterson

activecell column to a given range
 
Sometimes, I don't read as carefully as I should. This was one (or 4) of those
times.

Dave Peterson wrote:

Ahhhh. I missed that part.

with activesheet
.cells(.range("column_headers").row,activecell.col umn).Select
end with

Peter Morris wrote:

"Dave Peterson" wrote in message
...
Do you know the row number to go to?


No, that's the point.

To be precise, I know the row number NOW, but
as I develop my code Imight move the cells to a different
location. I don't waant tohard code a specific row
number.

Cells in the row are a named range "column_headers"
I want the current column within that range. Or an
alternative way to do this.


--

Dave Peterson


--

Dave Peterson

Peter Morris

activecell column to a given range
 

"Dave Peterson" wrote in message
...
Sometimes, I don't read as carefully as I should. This was one (or 4) of
those
times.

Dave Peterson wrote:

Ahhhh. I missed that part.

with activesheet
.cells(.range("column_headers").row,activecell.col umn).Select
end with



Thanks, that works.



Dave Peterson

activecell column to a given range
 
And only after a half dozen messages! <vbg

Peter Morris wrote:

"Dave Peterson" wrote in message
...
Sometimes, I don't read as carefully as I should. This was one (or 4) of
those
times.

Dave Peterson wrote:

Ahhhh. I missed that part.

with activesheet
.cells(.range("column_headers").row,activecell.col umn).Select
end with


Thanks, that works.


--

Dave Peterson


All times are GMT +1. The time now is 09:31 AM.

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