Hi, the following code in my VBA program is causing a range of object failed error.
VB Code:
Range(Sheets(sheetname).Cells(start, startCol), Sheets(sheetname).Cells(50, startCol)).ClearContents
It would only error if sheetname is not the current active sheet opened. Therefore I added
before it.VB Code:
Range(Sheets(sheetname).Cells(start,startCol).Value, Sheets(sheetname).Cells(50,startCol).Value).Activate
It STILL complained! I ran out of ideas.
Why wouldnt the compiler like the following code even after I activate the sheet?


Reply With Quote