#1   Report Post  
John
 
Posts: n/a
Default VBA Question

I have a little problem. I need to write a VBA. I have a button that will
print four letters that are located in a seperate worksheet. Currently I
have a macro that goes to that worksheet and prints all four. But I want to
have a pop-up that will ask Which letter they want to print. I believe that
this is possible, but i need some help developing it. Any help would be
appreciated.

Thank you

  #2   Report Post  
Rowan
 
Posts: n/a
Default

One way would be to record 4 different macros - one to print each
letter, in my example I have called them Print1, Print2, etc. Then
attach the macro below to your print button:

Sub Pintit()
Dim PReport As Variant
PReport = InputBox("Enter 1 to 4 for report to print" _
, "Print Report", 1)
Select Case PReport
Case 1
Call Print1
Case 2
Call Print2
Case 3
Call Print2
Case 4
Call Print4
Case ""
MsgBox "User Cancelled"
Case Else
MsgBox "You must enter and integer" & Chr(10) _
& "between 1 and 4"
End Select
End Sub

Hope this helps
Rowan

John wrote:
I have a little problem. I need to write a VBA. I have a button that will
print four letters that are located in a seperate worksheet. Currently I
have a macro that goes to that worksheet and prints all four. But I want to
have a pop-up that will ask Which letter they want to print. I believe that
this is possible, but i need some help developing it. Any help would be
appreciated.

Thank you

  #3   Report Post  
John
 
Posts: n/a
Default

Rowan

Thank you very much. It worked Perfectly. Thank very much for you help


"Rowan" wrote:

One way would be to record 4 different macros - one to print each
letter, in my example I have called them Print1, Print2, etc. Then
attach the macro below to your print button:

Sub Pintit()
Dim PReport As Variant
PReport = InputBox("Enter 1 to 4 for report to print" _
, "Print Report", 1)
Select Case PReport
Case 1
Call Print1
Case 2
Call Print2
Case 3
Call Print2
Case 4
Call Print4
Case ""
MsgBox "User Cancelled"
Case Else
MsgBox "You must enter and integer" & Chr(10) _
& "between 1 and 4"
End Select
End Sub

Hope this helps
Rowan

John wrote:
I have a little problem. I need to write a VBA. I have a button that will
print four letters that are located in a seperate worksheet. Currently I
have a macro that goes to that worksheet and prints all four. But I want to
have a pop-up that will ask Which letter they want to print. I believe that
this is possible, but i need some help developing it. Any help would be
appreciated.

Thank you


  #4   Report Post  
Rowan
 
Posts: n/a
Default

You're welcome.

"John" wrote:

Rowan

Thank you very much. It worked Perfectly. Thank very much for you help


"Rowan" wrote:

One way would be to record 4 different macros - one to print each
letter, in my example I have called them Print1, Print2, etc. Then
attach the macro below to your print button:

Sub Pintit()
Dim PReport As Variant
PReport = InputBox("Enter 1 to 4 for report to print" _
, "Print Report", 1)
Select Case PReport
Case 1
Call Print1
Case 2
Call Print2
Case 3
Call Print2
Case 4
Call Print4
Case ""
MsgBox "User Cancelled"
Case Else
MsgBox "You must enter and integer" & Chr(10) _
& "between 1 and 4"
End Select
End Sub

Hope this helps
Rowan

John wrote:
I have a little problem. I need to write a VBA. I have a button that will
print four letters that are located in a seperate worksheet. Currently I
have a macro that goes to that worksheet and prints all four. But I want to
have a pop-up that will ask Which letter they want to print. I believe that
this is possible, but i need some help developing it. Any help would be
appreciated.

Thank you


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
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM
Anybody Help with previous question Anthony Excel Discussion (Misc queries) 1 July 26th 05 01:26 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM


All times are GMT +1. The time now is 07:51 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"