ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro - move active cell to another column; same row (https://www.excelbanter.com/excel-programming/411462-macro-move-active-cell-another-column%3B-same-row.html)

BLW

Macro - move active cell to another column; same row
 
I am writing a macro where it starts off with a (startrow) reference that is
a value in an active cell. The macro inserts new rows and formatings. At
the end I want it to enter a value into the cell two columns to the right of
the (startrow). I am having trouble getting it to select the right cell - it
keeps selecting the (startrow) cell and changing that value.

How do I get it to move to another column with only specifying how many
columns over to move and not an exact column.



Don Guillett

Macro - move active cell to another column; same row
 
As ALWAYS, post your code for comments but

activecell.offset(,8).value="yeah"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"BLW" wrote in message
...
I am writing a macro where it starts off with a (startrow) reference that
is
a value in an active cell. The macro inserts new rows and formatings. At
the end I want it to enter a value into the cell two columns to the right
of
the (startrow). I am having trouble getting it to select the right cell -
it
keeps selecting the (startrow) cell and changing that value.

How do I get it to move to another column with only specifying how many
columns over to move and not an exact column.




Norman Jones[_2_]

Macro - move active cell to another column; same row
 
Hi BlW,

Try using the Range's Offset property.

For example, try someting like:

Dim myVal as Long

myVal =20

Range(StartCell).Offset(0,2).Value = myVal



---
Regards.
Norman


"BLW" wrote in message
...
I am writing a macro where it starts off with a (startrow) reference that
is
a value in an active cell. The macro inserts new rows and formatings. At
the end I want it to enter a value into the cell two columns to the right
of
the (startrow). I am having trouble getting it to select the right cell -
it
keeps selecting the (startrow) cell and changing that value.

How do I get it to move to another column with only specifying how many
columns over to move and not an exact column.





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

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