Extend Series Right

Marhier

Board Regular
Joined
Feb 21, 2017
Messages
128
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi everyone.
Got a small problem I'm really struggling to get my head around.

Is there a VBA code that lets me take the active cell and extend the series to the next cell on the right, just like you'd do with your mouse manually as shown in the following picture:

<a href="https://imgbb.com/"><img src="https://thumb.ibb.co/nPw6fL/Test.jpg" alt="Test" border="0"></a>


I've got a bit of code that inserts a column, but can't figure out what to put next:

Code:
Sub AddWeek()
Application.Goto Reference:="InsWeekCol"
Selection.Insert Shift:=xlToRight
Range("A5").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Select
[B]?????????[/B]
End Sub

All help is greatly appreciated.
Thank you.
Regards
Marhier.
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try this:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG20Nov14
[COLOR="Navy"]With[/COLOR] Range("A1")
.Value = "WK1"
.AutoFill Destination:=Range("A1:Z1"), Type:=xlFillSeries
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
I managed to get that to work, thank you.
\m/

Regards
Marhier
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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