Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button to generate report

Hi, I'm very new to VBA. I have a worksheet with 5 fields (a1-a2-a3-a4-a5). I
want to create a button that will generate a new file to make some sort of
invoice with the name in cell a1 and the numbers in cells a2-a3-a4-a5. How
can I do this?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Button to generate report

The following macro takes the values in A1:A5 of the active sheet and copies
them to A1:A5 of the InventorySheet. Place a Forms button (View -
Toolbars - Forms, click on the button icon and draw the button where you
want it) and assign this macro to that button.
Sub GenerateInvoice()
With Sheets("InventorySheet")
Range("A1:A5").Copy .Range("A1")
End With
End Sub

Note that there is a space after the word "Copy". Place his macro in a
normal module. HTH Otto
"juniorc" wrote in message
...
Hi, I'm very new to VBA. I have a worksheet with 5 fields
(a1-a2-a3-a4-a5). I
want to create a button that will generate a new file to make some sort of
invoice with the name in cell a1 and the numbers in cells a2-a3-a4-a5. How
can I do this?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Button to generate report

Hi, begin recording a macro that does what you are trying to do. Then
add a command button and right click it change the name and caption
properties to your suite your needs. Double click on the button (in
design view) and the code window will pop up with similar code:
Sub CommandButton1_Click()
'Enter the following line
Call 'your macro name here'
End Sub

Hopefully, this gives you a place to start--Lonnie M.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me to generate a report Saz New Users to Excel 3 April 22nd 08 05:35 PM
Can I generate a report for my classroom? (I APPRECIATE YOUR HELP Steve Excel Worksheet Functions 1 March 28th 07 02:48 AM
Can I generate a report for my classroom? (I APPRECIATE YOUR HELP Toppers Excel Worksheet Functions 0 March 27th 07 11:59 PM
Generate Report Peter Carlson Excel Worksheet Functions 2 April 12th 06 05:54 AM
How to Generate the Excel report By Using ASP Drashan Singh Excel Programming 0 November 18th 04 12:24 PM


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"