moradisndat
New Member
- Joined
- Feb 19, 2021
- Messages
- 15
- Office Version
- 2007
- Platform
- Windows
Trying to speed up macro. Need to copy a range of 4 columns and 25k rows from one sheet to another. Sheets are named on tabs. I declared variables as public at top for use by more than 1 sub. The problem is that only 1 cell is copied over.
This is what I have:
Set ws = ThisWorkbook.Sheets("Import")
Set wsNew = ThisWorkbook.Sheets("PSI")
Set rng = ws.Range("A1").CurrentRegion
'I tried both of the following:
wsNew.Range("A50") = rng.Value
wsNew.Range("A50").CurrentRegion = rng.Value
I figured the 2nd statement wouldn't work because it is a blank sheet.
Also, I need the numerical formats copied with the values.
This is what I have:
Set ws = ThisWorkbook.Sheets("Import")
Set wsNew = ThisWorkbook.Sheets("PSI")
Set rng = ws.Range("A1").CurrentRegion
'I tried both of the following:
wsNew.Range("A50") = rng.Value
wsNew.Range("A50").CurrentRegion = rng.Value
I figured the 2nd statement wouldn't work because it is a blank sheet.
Also, I need the numerical formats copied with the values.