I keep on getting the error out of range. Can somone please tell me what needs to be changed in order to make this code work?
Sub InsertBaldata3()
Dim myRowCount As Integer
Dim myRng As Range
Set myRng = Sheets("insert balance data (2)".Range("1:1"
myRowCount = Application.CountA(myRng) - 1
With Sheets("company balance sheet(2)"
.Cells(myRowCount + 5, 5).Value = myRng.Range("b8".Value
.Cells(myRowCount + 6, 5).Value = myRng.Range("b9".Value
.Cells(myRowCount + 8, 5).Value = myRng.Range("b11".Value
.Cells(myRowCount + 9, 5).Value = myRng.Range("b12".Value
.Cells(myRowCount + 10, 5).Value = myRng.Range("b13".Value
.Cells(myRowCount + 11, 5).Value = myRng.Range("b14".Value
.Cells(myRowCount + 13, 5).Value = myRng.Range("b16".Value
.Cells(myRowCount + 14, 5).Value = myRng.Range("b17".Value
.Cells(myRowCount + 15, 5).Value = myRng.Range("b18".Value
End With
End Sub
Sub InsertBaldata3()
Dim myRowCount As Integer
Dim myRng As Range
Set myRng = Sheets("insert balance data (2)".Range("1:1"
myRowCount = Application.CountA(myRng) - 1
With Sheets("company balance sheet(2)"
.Cells(myRowCount + 5, 5).Value = myRng.Range("b8".Value
.Cells(myRowCount + 6, 5).Value = myRng.Range("b9".Value
.Cells(myRowCount + 8, 5).Value = myRng.Range("b11".Value
.Cells(myRowCount + 9, 5).Value = myRng.Range("b12".Value
.Cells(myRowCount + 10, 5).Value = myRng.Range("b13".Value
.Cells(myRowCount + 11, 5).Value = myRng.Range("b14".Value
.Cells(myRowCount + 13, 5).Value = myRng.Range("b16".Value
.Cells(myRowCount + 14, 5).Value = myRng.Range("b17".Value
.Cells(myRowCount + 15, 5).Value = myRng.Range("b18".Value
End With
End Sub