Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
I am trying to copy an none empty cell from Sheet2 column A TO sheet1 cell B1 , but i am having issues. I have tried to set it to sheet2 but it gives me an error on xCell.Select. If I leave it as it is then I get an error on this row
[/CODE]
VBA Code:
Sheets("Sheet1").Range("b1").End(xlDown).Offset(1, 0).Paste
VBA Code:
[CODE=vba]
Dim xCell As Range
Set ws = Sheets("Sheet2")
For Each xCell In ActiveSheet.Columns(1).Cells '''' currently set to active sheet, which will be sheet1, HOWEVER NEED TO SEARCH SHEET2 COLUMN1
If Len(xCell) <> "" Then
xCell.Select
Set ws = Sheets("Sheet2")
ws.Range(ws.Range("a1"), ws.Range("a1").End(xlDown)).Copy
Sheets("Sheet1").Range("b1").End(xlDown).Offset(1, 0).Paste
End If
Exit For