can this be done with a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top