Storing Row with VBA

Carl Clements

Board Regular
Joined
Jun 13, 2008
Messages
95
Hi,

I have some code that inserts a new row to a spreadsheet when it find the first row without data in column A. Is there some code that then stores the row number it's on? i suppose it would be something like StoreRow = ActiveRow.Address

I then need some code that allows me to move down the required number of rows from a fixed cell to arrive at the stored row. Is there some code for this also?

Thanks,
Carl
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Thanks. And what is the code to move down from the row with active cell to the stored row?

I need to get from cell E9 to D14 (Row 14 is the stored row). E9 (or row 9) will be constant but the stored row number will be different each day, ie it will be D15 the next day.
 
Upvote 0
Thanks. However, only only Row 9 will be constant, not cell E9. The column can change. I have stored the cell variable as StoreLocation

So I tried the below but it takes me to Row 914 for some random reason

Range(StoreLocation & NewRow).Select

Any suggestions?
 
Upvote 0
Not sure what the last reply means but I need some code that can store the column. I believe it needs to convert the column letter into a number somehow?
 
Upvote 0
Like this?

StoreCol=ActiveCell.Column

You can then get back using

Cells(StoreRow, StoreCol).Select
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,304
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top