Can anyone help a newbie with a simple macro?

Jo-AnneC

New Member
Joined
Jan 25, 2005
Messages
13
I hope someone can help me to get this to work. It only works on the first sheet in the workbook, so I must have done something really stupid.... I have been trying to get it to work for hours and hours....ughhh!

Sub TestFile()
For Each Sh In ThisWorkbook.Worksheets
With Sh
Range("B3:K12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Range("N3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Range("M8:M12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Range("B19:N23").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End With
Next Sh
End Sub

Jo-Anne
 
Hey Dan

Thanks for that. I did not know you could do that. Actually, don't know how to do a great deal of anything with code, but am very grateful for help.

There is no-one to ask about anything here. I went to the IT dept when I started this project and they just said that they DO NOT (ouch!) support anything in Excel or Access... They also did not say how complicated this project would be for a non-vb user... I will get to the end of it.

What a pickle.

(y)
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi Jo-AnneC,
You're welcome. Glad it helped.

As for your project & the IT guys?... you'll be much better for it at the end!
(And with some of these folks here, you can get better help than anyone in your IT department has to offer! :devilish: )

Morning Nimrod! How did your post get in there last night??? I must've slid right past it without even seeing it. :unsure:

Dan
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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