Forum Discussion
peysg
Jul 28, 2022Copper Contributor
Using lastrow variable in range
Hi, I have created a last row variable in VBA and want to use them in range to copy a range of SPECIFIC COLUMN (e.g. B1 to last row and E to last row) but couldn't get it to work (See code in red). T...
Harun24HR
Jul 28, 2022Bronze Contributor
Your use of double quote "" is wrong. Try below line-
Set table=Worksheets("Database").Range("B1:B" & lastrow, "E1:E" & lastrow)- peysgJul 28, 2022Copper Contributor
This doesnt work, it still copy columns from B to E, i want to skip column C & D
- HansVogelaarJul 28, 2022MVP
Set table = Worksheets("Database").Range("B1:B" & lastrow & ",E1:E" & lastrow)- peysgJul 28, 2022Copper ContributorApologies, this doesnt work. It still copy column B to E. I want to skip column C & D