Using a button to copy range of cells to another sheet

wberg82

New Member
Joined
Feb 19, 2016
Messages
38
I am having trouble writing a macro that when I hit a certain button it copies the data in a range and then pastes it to another sheet to the next available row.

For example, I have 2 sheets: Load List & Hardware. In the hardware sheet, I have button that when I click on it, I want it to copy range B5:E5 and then paste it to the Load List sheet to the next available row starting at C11.

I will have multiple buttons that copy different ranges and paste them to the next available row in the Load List sheet.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
How about
Code:
Sub wberg82()
   Range("B5:E5").Copy Sheets("Load List").Range("C" & Rows.count).End(xlUp).Offset(1)
End Sub
 
Upvote 0
WOW that was easy! :). However, it copies the button as well, which I don't want. Any it copies the formatting, which I also don't want. I just want it to copy the text.

I am guessing for every button I create, I need to create a script for the range I want it to copy?

Thanks
 
Upvote 0
How about
Code:
Sub wberg82()
   Sheets("Load List").Range("C" & Rows.count).End(xlUp).Offset(1).Resize(, 4).Value = Range("B5:E5").Value
End Sub

I am guessing for every button I create, I need to create a script for the range I want it to copy?
Without knowing anything about your data, or what you are trying to do,then probably.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,261
Members
448,558
Latest member
aivin

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