VBA Moving a cell one cell to the right

alexfooty

Board Regular
Joined
Dec 30, 2018
Messages
97
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have 21 columns of data C99:W99
Excel Move.png

I need a macro to move the orange cell (C100) one cell to the right each time the macro is run. When it eventually reaches cell W100 I need it to return to C100
Many thanks
 
Hi Peter - One small problem I've discovered with the macro above. When all the rows are filled with data down to row 74, it start to paste the data at the beginning again but into row 41 instead of row 40.
VBA2.png
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
When all the rows are filled with data down to row 74
What is supposed to happen then? Should all the data in rows 40:74 be cleared?
I'm wondering partly because of my question below but also partly because your image shows empty cells except for one.

If not, how would the code decide what row to write on? Sure, when all the rows first get filled, it would be easy enough to write the next value in AN40 but on the next run through there would be no way to know what cell was written to last time.
 
Upvote 0
You've actually sorted my problem with your reply. All of the figures will be copied & pasted elsewhere and the table will be blank again. When I tried this everything returned back to normal.
Until your reply I hadn't actually thought of what I would do with the data. A bit of forward planning on my behalf would have helped. Sorry to have messed you about.
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

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