Setup a macro to select a specific column within the same row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How would I setup a macro to select a different cell column within the same
row? I know that I can use the ROW() function to identify the current row.
But I'd like to setup a macro that would goto, let's say, column E of the
current row. I've tried concatenating, using formaulaes like "EROW()", "E +
ROW()", "$E$ROW()" and more but nothing seems to work for me. The idea being
that regardless of current cell, I can make select a specific column within
the same row for cell data replacement purposes.
 
sub selectnew
curro = activecell.row
cells(curro,columnnumberyouwanttoselct).select
end sub
 
row() works in worksheet formulas, but isn't really used in VBA.

cells(ActiveCell.Row,"E").Select
might be what you want.

or

Cells(activeCell,5).Select
 
Indio,

Perhaps:

Cells(Activecell.Row,5)

to use column E of the current row?

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top