Try to use "A1"
instead of A1
and "E"
instead of E
.
How can I fix the error "Method 'range of object'_Worksheet' failed
How can I fix the error "Method 'range of object'_Worksheet' failed
'كود الترحيل الى الشيت المساعد'
Dim lr_help1 As Integer
lr_help1 = helpsheet.Range("A100").End(xlUp).Row + 1
helpsheet.Cells(lr_help1, "A").Value = Me.txtproduct.Value
helpsheet.Cells(lr_help1, "B").Value = Me.txtunite.Value
helpsheet.Cells(lr_help1, "C").Value = Me.txtbuy.Value
helpsheet.Cells(lr_help1, "D").Value = Me.txtsale.Value
helpsheet.Cells(lr_help1, "E").Value = Me.txtmount.Value
Me.ListBox1.Clear
Me.ListBox1.Height = 235
Me.ListBox1.Width = 545
Me.ListBox1.ColumnCount = 5
Me.ListBox1.ColumnWidths = "120,90,90,90,90"
Dim LR_HELP2 As Integer
LR_HELP2 = helpsheet.Range("A100").End(xlUp).Row
Me.ListBox1.List = helpsheet.Range(A1, E & LR_HELP2).Value
''كود الجمع التلقائى ''
Dim V1, V2 As Long
V1 = Me.txtsub_totale.Value
V2 = Val(Me.txtsale.Value) * Val(Me.txtcount.Value)
Me.txtsub_totale.Value = Val(V1) + Val(V2)
Me.txtproduct.Value = ""
Me.txtunite.Value = ""
Me.txtbuy.Value = ""
Me.txtsale.Value = ""
Me.txtmount.Value = ""
End Sub
1 answer
Sort by: Most helpful
-
Viorel 119.7K Reputation points
2025-02-08T02:37:13.4133333+00:00