How can I fix the error "Method 'range of object'_Worksheet' failed

emad awad 0 Reputation points
2025-02-07T22:18:10.2766667+00:00

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

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,151 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,245 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 119.7K Reputation points
    2025-02-08T02:37:13.4133333+00:00

    Try to use "A1" instead of A1 and "E" instead of E.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.