Related:
- Help in Excel macro
- Spell number in excel without macro - Guide
- Gif in excel - Guide
- Macros in excel download free - Download - Spreadsheets
- Marksheet in excel - Guide
- How to take screenshot in excel - Guide
1 response
You might want to try assigning the sheet names to the variables. If you work between sheets, Excel will get
"confused" if you just say....for example, Range("A1"). It is fine in the active sheet, but once you start moving
between sheets, then Range("A1") of what sheet?
For example:
Instead of,
K = Range("A65536").End(xlUp).Row 'finding the last row before blank
Co = Range("A1").End(xlToRight).Column 'Finding the last Column before blank
Try:
K= Sheets("MySheet").Range("A65536").End(xlUp).Row
Co = Sheets("MySheet").Range("A1").End(xlToRight).Column
"confused" if you just say....for example, Range("A1"). It is fine in the active sheet, but once you start moving
between sheets, then Range("A1") of what sheet?
For example:
Instead of,
K = Range("A65536").End(xlUp).Row 'finding the last row before blank
Co = Range("A1").End(xlToRight).Column 'Finding the last Column before blank
Try:
K= Sheets("MySheet").Range("A65536").End(xlUp).Row
Co = Sheets("MySheet").Range("A1").End(xlToRight).Column
Mar 26, 2009 at 11:28 AM
It worked...I was not activating the worksheet