rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I am trying to move data from my active worksheet to a destination worksheet without using specific named ranges. When I run the code below, I get the following error: "Run-Time error '438': Object doesn't support this property or method." The line with my resize text is the line of text highlighted when I select debug from the pop-up window.
How to I fix this? I am guessing it has something to do with how I am using the Tx cell, TxSheet, and DestCell terms.
Thanks for the help.
How to I fix this? I am guessing it has something to do with how I am using the Tx cell, TxSheet, and DestCell terms.
Code:
Sub CORRECTION()
Application.ScreenUpdating = False
Dim Lrow As Long
Dim MyRow As Long
Dim TxCell As String
Dim TxSheet As String
Dim DestCell As String
TxSheet = ActiveSheet.Name
TxCell = ActiveCell.Address
Sheets("Corrections").Activate
Sheets("Corrections").Calculate
[COLOR=#008000]' Find the last row in column A[/COLOR]
On Error Resume Next
Lrow = Cells.Find(What:="*", _
After:=Range("A1"), _
lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
MyRow = Lrow + 1
DestCell = Range("A" & MyRow)
Sheets("Corrections").DestCell.Resize(1, 2).Value = Sheets(TxSheet).Range(TxCell).Resize(1, 2).Value
Sheets(TxSheet).Activate
Application.ScreenUpdating = True
End Sub
Thanks for the help.