redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,604
- Office Version
- 365
- Platform
- Windows
Hi all
I'm trying to get the above code to copy the value of cell B3 in weekly perf tab into next available row of column X in graphs tab.
When the value is pasted it is done so by using the formula as shown.
However the code sticks with an error "application defined or object defined error" on the
any ideas to fix
many thanks
Code:
Sub Ant()
Dim FinalRow As Long
Dim myValue As Variant
myValue = Sheets("weekly perf").Range("B3")
Sheets("graphs").Select
' Find the last row of data
FinalRow = Range("X" & Rows.Count).End(xlUp).Row
With Range("X" & FinalRow)
.Formula = "=RIGHT(" & myValue & ",FIND("" - ""," & myValue & ")-2)"
End With
End Sub
I'm trying to get the above code to copy the value of cell B3 in weekly perf tab into next available row of column X in graphs tab.
When the value is pasted it is done so by using the formula as shown.
However the code sticks with an error "application defined or object defined error" on the
Code:
.Formula = "=RIGHT(" & myValue & ",FIND("" - ""," & myValue & ")-2)"
any ideas to fix
many thanks