strong100m
New Member
- Joined
- Jan 28, 2016
- Messages
- 11
I am trying to create a VBA to copy a value from an specific cell and worksheet (example: cell A1 in worksheet "Info"), to the first available row in a specific named range ("test") in worksheet "Data".
So far I have gotten this but it doesn't seems to work:
Sub SaveData()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim LastRow As Long
Set ws1 = Sheets("Info")
Set ws3 = Sheets("Data")
LastRow = ws2.Range("Test").Rows.Count + 1
ws1.Range("A1").Copy ws3.Range("Test" & LastRow)
End Sub
Can someone please help me with this code?
So far I have gotten this but it doesn't seems to work:
Sub SaveData()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim LastRow As Long
Set ws1 = Sheets("Info")
Set ws3 = Sheets("Data")
LastRow = ws2.Range("Test").Rows.Count + 1
ws1.Range("A1").Copy ws3.Range("Test" & LastRow)
End Sub
Can someone please help me with this code?