Selecting multiple cells using offset

linesite

New Member
Joined
Oct 10, 2009
Messages
41
This officially is the first bit of functional VBA that I've managed to put together on my own to help streamline and edit a spreadsheet. My idea was paste data in another row and select three cells two rows down and nine columns to the left and start the process over. This code works fine; however, I can't program code with offset to select more than one cell on the same row (last line of code). What can I add to this row of code to get offset to select three consecutive cells on the same row to start editing process over?

Sub MoveRowData()

' MoveRowData Macro
' Keyboard Shortcut: Ctrl+Shift+R

ActiveCell.Activate
Selection.Cut

ActiveCell.Offset(-1, 9).Select
ActiveSheet.Paste

ActiveCell.Offset(3, -9).Select

End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Do you mean something like this?
Code:
    Range(ActiveCell.Offset(3, -9), ActiveCell.Offset(3, -6)).Select
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,508
Members
452,918
Latest member
Davion615

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