Macro Copy assistance

rlc

New Member
Joined
Feb 11, 2010
Messages
41
I would like to use this macro on multiple sheets within this workbook with the same ranges. I would like to copy the Hoffman formats to the next new worksheet. I tried removing "Vierthaler", however my syntax or something is not formatted properly. I want to copy multiple times using this macro. Thanks for any assistance you can provide.

' CopyFormatFormula Macro
'
'
Range("F27:F38").Select
Selection.Copy
Sheets("Vierthaler").Select
Range("F27").Select
ActiveSheet.Paste
Sheets("Hoffman").Select
Range("H27:H38").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Vierthaler").Select
Range("H27").Select
ActiveSheet.Paste
Sheets("Hoffman").Select
Range("I27:I38").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Vierthaler").Select
Range("I27").Select
ActiveSheet.Paste
End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
This is a little bit simpler:

Code:
Sub CopyFormatFormula()
'
'
Sheets("Hoffman").Range("F27:F38").Copy ActiveSheet.Range("F27")
Sheets("Hoffman").Range("H27:H38").Copy ActiveSheet.Range("H27")
Sheets("Hoffman").Range("I27:I38").Copy ActiveSheet.Range("I27")

End Sub
 
Upvote 0
I assumed you always wanted the values copied from "Hoffman" to a new sheet. Run this macro when you have the new sheet activated.
 
Upvote 0
Do you want add a new sheet and there copy the Hoffman ranges ? why are you copying in "Vierthaler" Sheet ?
 
Upvote 0
Thanks, Jeffrey that did it. I am not sure what you mean by "Code" tags. Code you elaborate so I will properly address the forum if I have a future VBA type question. For Patel45, Hoffman is the source of where I fixed some formating items, and Vierthaler is the person I recorded it to. I have 20 more files to fix. I never really had to manually manipulate a macro before.
 
Upvote 0
Below the typing window you will see an "Advanced" button. Click that. Above the typing window are some new icons. One of them looks like the pound sign or hashtag "#". When you click that, it creates a a CODE on and CODE off. You can highlight your code and then click on the CODE icon and it will surround the code with "[ CODE ]" and [ /CODE ]" .
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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