strange Unspecified Error on userform when run 2007 version

Abdo

Board Regular
Joined
May 16, 2022
Messages
228
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hi Guys,
I'm not sure why shows Unspecified Error :unsure: when try run the form on 2007 version and when close the file and run gain the error doesn't show , but shows from time another time !
when debug the error will stop on UserForm1.Show and try use F8 it keep in this line UserForm1.Show
I'm not sure what's the problem!:rolleyes:
here is the code
VBA Code:
Private Sub CommandButton1_Click()
Dim LR As Long
Dim ws As Worksheet

Set ws = Sheets("GOODS")
With ws
    ' determine last used cell in column B
    LR = .Range("B" & .Rows.Count).End(xlUp).Row
[B]    
    .[/B]Rows(LR - 1).Insert xlShiftDown, xlFormatFromLeftOrAbove
    .Rows(LR - 1).Value = .Rows(LR).Value
    ' copy UserForm values to last row
    .Range("B" & LR) = Date
    .Range("C" & LR) = TextBox1.Text
    .Range("D" & LR) = TextBox2.Text
    .Range("E" & LR) = TextBox3.Text
    .Range("F" & LR) = TextBox4.Text
End With
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""

End Sub
any opinions guys?
 
If the textbox's have no row source set then the only thing I can suggest (again) is that you specify your textboxes (ie. Userform1.TextBox1.Text). Beyond this, I'm sorry but I have no further suggestions. Good luck. Dave
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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