Simple change ?

R

Robert Gillard

A little while ago I asked how to automatically update 18 rows across
several spreadsheets and was given the following solution which works really
well.
Now I only have one spreadsheet that I wish to update (sheet1), I have tried
to amend the code by changing bits of it, but I still cannot get it to work.

Could somebody please let me know how to change it so only sheet1 is now
updated

With Thanks

Bob



Sub Macro7()
'
' Macro7 Macro
'
Dim Rng As Range
Dim wks
Dim ws

wks = Array("Sheet1", "Sheet4", "Sheet5", "Sheet7")
For Each ws In wks
Worksheets(ws).Select
Set Rng = Range("B27").End(xlToRight).Resize(18, 1)
Rng.AutoFill Destination:=Rng.Resize(Rng.Rows.Count, 2)
Next
Worksheets("Sheet1").Select
End Sub
 
R

Ron de Bruin

Try this

Dim Rng As Range
Worksheets("Sheet1").Select
Set Rng = Range("B27").End(xlToRight).Resize(18, 1)
Rng.AutoFill Destination:=Rng.Resize(Rng.Rows.Count, 2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top