ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   can this be done with a macro? (https://www.excelbanter.com/excel-discussion-misc-queries/53386-can-done-macro.html)

deo89

can this be done with a macro?
 
I have a user that has a worksheet in a workbook with a table of data. He
wants to create a macro button on that worksheet that takes the data from a
certain range in the table and pastes it into the next available column on a
separate worksheet in the same workbook... ie, paste into col. A the first
time the 'submit' macro button is clicked, into col. B the next time, etc..

What is the best way to approach doing this and any help with macro syntax?

thx

Don Guillett

can this be done with a macro?
 
this can be done from anywhere in the workbook where sr is the named source
range

Sub copyrangetocol()
With Sheets("Sheet9") 'destination sheet
x = .Cells(1, Columns.Count).End(xlToLeft).Column + 1
[sr].Copy .Columns(x) 'sr is a named range
End With
End Sub

--
Don Guillett
SalesAid Software

"deo89" wrote in message
...
I have a user that has a worksheet in a workbook with a table of data. He
wants to create a macro button on that worksheet that takes the data from

a
certain range in the table and pastes it into the next available column on

a
separate worksheet in the same workbook... ie, paste into col. A the first
time the 'submit' macro button is clicked, into col. B the next time,

etc..

What is the best way to approach doing this and any help with macro

syntax?

thx





All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com