Forum Discussion
BrianP475
May 05, 2025Copper Contributor
Copy/Paste Macro using ActiveSheet
Hello I am trying to do something I think for most would be simple, but I am getting hung up. I want to be able to run a macro that will copy the items in column B 11-21 of the ActiveSheet, an...
- May 08, 2025
See the attached workbook. So that you do not have to worry about malicious code executing upon opening the workbook, this is not a macro-enabled workbook. Instead, I placed the relevant code into the _Code worksheet. But read the information on the _Info worksheet first.
BrianP475
May 09, 2025Copper Contributor
So I tried to edit the code to include more cells. When I do so I get a method error. So I created 2 more Subs within one module. I get the results I want that way, but I have to run 3 different macros. Is there a punctuation mark used for adding on to the original code? I've tried using a comma, and a semi colon. Ive attached what I was trying to do.
HansVogelaar
May 12, 2025MVP
Change
strRange = "B2:B9;B11:B21"
to
strRange = "B2:B9,B11:B21"
(comma instead of semicolon)
- BrianP475May 12, 2025Copper Contributor
I messed with it a little the other day, and did what you have posted. I also had to add parenthesis around the argument to get it to work. Now Im researching how to make it so when I transfer to the next sheet it uses the first cell available in that range. So if something is already in cell B2 then it will transfer to the cell below. If not it will go to cell B2. Even if it originated from lets say cell B4 on the previous sheet it will transfer to cell B2 for the next sheet. I do thank you for your help. Im at least able to use this at work now since you gave me the code.