Can you have a USERFORM open at the beginning of Macro

Darth_Popsicle

New Member
Joined
Apr 23, 2017
Messages
7
I have a Macro creating an entire new sheet / form in a new tab from the click of a command button. I've built a user form and I've been trying to add VBA code so the userform will pop up at the beginning of the macro for the individual to input the data needed. The userform is titled ISO_DATA.
A. Can this be done?
B. Can you share the code ?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Darth_Popsicle, welcome to MrExcel.
Not sure what you exactly mean, but a line like the below will display your userform on screen ...
VBA Code:
ISO_DATA.Show
 
Upvote 0
I have tried this a couple of times and I keep getting the error 'an object is required' any clue as to what i have messed up?
 
Upvote 0
VBA Code:
[
Sub Potential_ISO_AGENT()

Application.ScreenUpdating = False

    Application.EnableEvents = False
    
    ISO_DATA.Show

Sheets.Add After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "AGENT NAME HERE"
'Merchant Data Needed
]
 
Upvote 0
Not by guessing, so if you would care to post the code you have so far, that would be helpful to be able to help you.
 
Upvote 0
On which line does the error occur?
 
Upvote 0
.... what's the code in your userform?
 
Upvote 0
Her is the code in the user form:


VBA Code:
[
Private Sub cmdNext_Click()
Range("B6").Value = Txt_Merchant_Name.Value
Range("B7").Value = Txt_Agent_ISO_Name.Value
Range("B8").Value = Txt_Avg_Monthly_Volume.Value
Range("B10").Value = Txt_Avg_Monthly_Chargebacks.Value
Range("B11").Value = Txt_Average_Ticket.Value
Range("B12").Value = Txt_Account_Type.Value
End Sub
]
 
Upvote 0
If that is all your code, and all six (assuming they are) text boxes are present I have no clou why your userform does not show.
I would recommend stepping through the code using F8 key.
 
Upvote 0
Here is the
VBA Code:
[
Sub Potential_ISO_AGENT()

Application.ScreenUpdating = False

    Application.EnableEvents = False
    
    ISO_DATA.Show

Sheets.Add After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "AGENT NAME HERE"
'Merchant Data Needed
    Range("A6").Select
    ActiveCell.FormulaR1C1 = "Merchant Name"
    Range("A7").Select
    ActiveCell.FormulaR1C1 = "Agent/ISO Name"
    Range("A8").Select
    ActiveCell.FormulaR1C1 = "Average Monthly Volume"
    Range("A9").Select
    ActiveCell.FormulaR1C1 = "Average Monthly Transactions"
    Range("A10").Select
    ActiveCell.FormulaR1C1 = "Average Monthly Chargebacks"
    Range("A11").Select
    ActiveCell.FormulaR1C1 = "Average Ticket"
    Range("A12").Select
    ActiveCell.FormulaR1C1 = "Account Type"
Application.ScreenUpdating = True
    
    
    End Sub
]
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top