Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard mouse network not working printer problem ram registry repair router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Excel Macro help - copying user defined row

Reply  
Thread Tools
Bonmarche's Avatar
Junior Member with 2 posts.
 
Join Date: Jul 2010
28-Jul-2010, 10:00 AM #1
Unhappy Solved: Excel Macro help - copying user defined row
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's Avatar
Computer Specs
Senior Member with 3,541 posts.
 
Join Date: Mar 2008
Location: Oegstgeest, The Netherlands
Experience: Never too old to learn!
28-Jul-2010, 10:11 AM #2
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's Avatar
Junior Member with 2 posts.
 
Join Date: Jul 2010
28-Jul-2010, 10:31 AM #3
Smile Sorted
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's Avatar
Computer Specs
Senior Member with 3,541 posts.
 
Join Date: Mar 2008
Location: Oegstgeest, The Netherlands
Experience: Never too old to learn!
28-Jul-2010, 05:28 PM #4
If this has answered your question, don't forget to press he Solved button on you post.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools


Similar Threads
Title Thread Starter Forum Replies Last Post
Excel Macro to open, save embedded pdf and word files mcledavid Business Applications 0 15-Sep-2009 04:54 PM
Excel Macro that copies whole rows vba_newbie Business Applications 5 13-Aug-2009 03:53 PM
Solved: Excel macro to separate entries in a single cell mrincognito Business Applications 11 05-Jun-2009 04:14 PM
Solved: Excel Macro help needed, please! davidgn Business Applications 39 15-Feb-2009 07:24 PM
Excel Macro to Copy a Row in a Spreadsheet newmac Business Applications 7 21-Nov-2008 05:36 AM


Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:44 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.