Solved: Excel Macro help - copying user defined row

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Bonmarche

Thread Starter
Joined
Jul 28, 2010
Messages
2
I have a spreadsheet containing a list of Invoices to print. As part of my Macro I need to be able to copy a row of data from the list (columns a to k), however the row will be different every time and is chosen by the user.

So I was looking at putting in a prompt to ask the row number to copy and go from there

Any help welcome.
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,611
welcome to the board. Dou you already have a macro that does anything special?
all you need is define a variable and an input box, then if the nr is a valid row exceute the copy command

e.a.g

Code:
Sub Sample()
    Dim xrow As Integer
    xrow = Application.InputBox("enter row nr.", "ROW", 2, , , , , 1)
    If cell(xrow, 1).Value = "" Then Exit Sub
    Range("A" & xrow & ":K" & xrow).Copy
    
    ' and here come the rest of the code to paste or whatever the macro has to do
    
End Sub
See if this helps you on the way
 

Bonmarche

Thread Starter
Joined
Jul 28, 2010
Messages
2
Thanks sorted that out now.

The macro now picks the Invoice data I need from a list, produces an Invoice, saves the info elsewhere and updates a list of Invoices raised.
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,611
If this has answered your question, don't forget to press he Solved button on you post.
:)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top