somnath_it2006
Well-known Member
- Joined
- Apr 11, 2009
- Messages
- 574
Hi All,
I want to find non-blank last cell of the sheet. I have a code but if there is any merge cell is there then its not working.
Above code gives the last cells column and row number.
But not working if merge cell is there.
Please help!!!!!
Thanks in advance....
I want to find non-blank last cell of the sheet. I have a code but if there is any merge cell is there then its not working.
Code:
lngLastRow = ObjWBTarget.Sheets(ObjWSTarget.Name).Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Row
lngLastCol = ObjWBTarget.Sheets(ObjWSTarget.Name).Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Above code gives the last cells column and row number.
But not working if merge cell is there.
Please help!!!!!
Thanks in advance....