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 ?
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
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
 

Darth_Popsicle

New Member
Joined
Apr 23, 2017
Messages
7
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?
 

Darth_Popsicle

New Member
Joined
Apr 23, 2017
Messages
7
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
]
 

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

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.
 

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
On which line does the error occur?
 

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

.... what's the code in your userform?
 

Darth_Popsicle

New Member
Joined
Apr 23, 2017
Messages
7
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
]
 

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
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.
 

Darth_Popsicle

New Member
Joined
Apr 23, 2017
Messages
7
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
]
 

Watch MrExcel Video

Forum statistics

Threads
1,127,105
Messages
5,622,763
Members
415,926
Latest member
jerrynababa

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
Top