Microsoft Excel stops responding on Macro run

egrospe

Board Regular
Joined
Feb 10, 2016
Messages
54
Hello,

I have a userform that transfers a bunch of data to a sheet on a button click. My codes used to work perfectly before and recently, it's been giving me troubles on button click. Microsoft consistently stops responding.

For some odd reason, MS Excel Stops responding right when it's time to transfer the value entered in "txtgroupID" textbox to the sheet (see red text below). When I disable this line and try to run it, everything works fine. What am I missing?

Code:
Private Sub cmdsubmit_Click()
Sheets("Form").Unprotect Password:="password"

'CONTRACT INFO
Sheets("Form").Range("H4") = txtOPCProjectName.Value
Sheets("Email").Range("C1") = txtOPCProjectName.Value
Sheets("Form").Range("H5") = txtOPCProjectNumber.Value
Sheets("Email").Range("C2") = txtOPCProjectNumber.Value
Sheets("Form").Range("N9") = txtOPCProjectNumber.Value 
Sheets("Form").Range("P5") = txtID.Value
[COLOR=#ff0000][B]Sheets("Form").Range("H6") = txtGroupID.Value [/B][/COLOR]
Sheets("Email").Range("C3") = txtGroupID.Value 
    
Sheets("Form").Range("H7") = cmbReviewer.Value
    Sheets("Email").Range("C4") = cmbReviewer.Value
Sheets("Form").Range("H8") = txtDateReviewed.Value
    Sheets("Email").Range("C5") = txtDateReviewed.Value
Sheets("Form").Range("H9") = txtCCN.Value
    Sheets("Email").Range("C6") = txtCCN.Value
Sheets("Form").Range("H10") = cmbCT.Value
    Sheets("Email").Range("C7") = cmbCT.Value
Sheets("Form").Range("H11") = cmbCTN.Value
    Sheets("Email").Range("C8") = cmbCTN.Value
Sheets("Form").Range("H12") = cmbIT.Value
    Sheets("Email").Range("C9") = cmbIT.Value
Sheets("Form").Range("H13") = txtPN.Value
    Sheets("Email").Range("C10") = txtPN.Value
Sheets("Form").Range("H14") = txtECN.Value
    Sheets("Email").Range("C11") = txtECN.Value

End Sub

Thanks in advance!!

Emmanuel
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,998
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
hi

does H6 have any formula that will be updated when the new value arrives?
just wondering if the sheet calculation is causing you a slow down.

dave
 

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,998
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
have you tried

Application.Calculation = xlCalculateManual

'''''''''''''''code

Application.Calculation = xlCalculateAutomatic

out of interest, i have used this allot.

Dave
 

egrospe

Board Regular
Joined
Feb 10, 2016
Messages
54
hi

does H6 have any formula that will be updated when the new value arrives?
just wondering if the sheet calculation is causing you a slow down.

dave

Hi Squidd,

I only have one cell that combines cells H5 and H6. Other than that, cell H6 is not updating any formulas.
 

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,998
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi

ok, its very strange, the code itself is not really doing much to go wrong

have you changed anything recently??

are any of the previous entries updaing formula

did you try the calculation manual automatic thing to iron out calculation issues.

Dave
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,898
Messages
5,834,295
Members
430,274
Latest member
TME1993

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