strange Unspecified Error on userform when run 2007 version

Abdo

Board Regular
Joined
May 16, 2022
Messages
183
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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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