View Single Post
 
Old 04-10-2013, 04:36 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi carrolld2,

The simplest approach is to press Ctrl-End, which takes you to the last active cell, then delete all unused columns and rows and re-save the workbook. Do this correctly, and pressing Ctrl-End will take you to the last used cell. The macro should then 'work as advertised'.

If that doesn't suit your needs, you could change:
LRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
LCol = .Cells.SpecialCells(xlCellTypeLastCell).Column - 1
to:
StrData = InputBox("Please input the last cell address")
LRow = .Range(StrData).Row
LCol = .Range(StrData).Column - 1
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote