Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default how to reset the activesheet usedrange value

if data is in a1:g50, a control end takes you to g50
if i want to clear this data, how do i reset the usedrange back to a1?

i have tried delete, clear and clearcontents, but a control end still takes
me to g50

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default how to reset the activesheet usedrange value

Visit Debra Dalgleish's site for some techniques for resetting that
lastusedcell.
http://www.contextures.com/xlfaqApp.html#Unused

Gary Keramidas wrote:

if data is in a1:g50, a control end takes you to g50
if i want to clear this data, how do i reset the usedrange back to a1?

i have tried delete, clear and clearcontents, but a control end still takes
me to g50

--

Gary


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default how to reset the activesheet usedrange value

thanks dave. that resizes my macro buttons, too. i'm not going to worry
about resetting the range

--


Gary


"Dave Peterson" wrote in message
...
Visit Debra Dalgleish's site for some techniques for resetting that
lastusedcell.
http://www.contextures.com/xlfaqApp.html#Unused

Gary Keramidas wrote:

if data is in a1:g50, a control end takes you to g50
if i want to clear this data, how do i reset the usedrange back to a1?

i have tried delete, clear and clearcontents, but a control end still
takes
me to g50

--

Gary


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default how to reset the activesheet usedrange value

Depending on what the buttons are, you can right click on each and choose Format
control and choose not to move or size with cells.



Gary Keramidas wrote:

thanks dave. that resizes my macro buttons, too. i'm not going to worry
about resetting the range

--

Gary

"Dave Peterson" wrote in message
...
Visit Debra Dalgleish's site for some techniques for resetting that
lastusedcell.
http://www.contextures.com/xlfaqApp.html#Unused

Gary Keramidas wrote:

if data is in a1:g50, a control end takes you to g50
if i want to clear this data, how do i reset the usedrange back to a1?

i have tried delete, clear and clearcontents, but a control end still
takes
me to g50

--

Gary


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default how to reset the activesheet usedrange value

i already have them set like that and they still resized when i ran the code

--


Gary


"Dave Peterson" wrote in message
...
Depending on what the buttons are, you can right click on each and choose
Format
control and choose not to move or size with cells.



Gary Keramidas wrote:

thanks dave. that resizes my macro buttons, too. i'm not going to worry
about resetting the range

--

Gary

"Dave Peterson" wrote in message
...
Visit Debra Dalgleish's site for some techniques for resetting that
lastusedcell.
http://www.contextures.com/xlfaqApp.html#Unused

Gary Keramidas wrote:

if data is in a1:g50, a control end takes you to g50
if i want to clear this data, how do i reset the usedrange back to a1?

i have tried delete, clear and clearcontents, but a control end still
takes
me to g50

--

Gary

--

Dave Peterson


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to reset the activesheet usedrange value


Unfortunately it is more complicated than that

Sub ResetUsedRange()
Dim iLastRow As Long
Dim iLastCol As Long
Dim rng As Range


With ActiveSheet
iLastRow = 0
iLastCol = 0
Set rng = .UsedRange
On Error Resume Next
iLastRow = Cells.Find(What:="*", _
After:=Range("A1"), _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
iLastCol = Cells.Find(What:="*", _
After:=Range("A1"), _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
On Error GoTo 0

.Range(.Cells(iLastRow + 1, 1), _
.Cells(.Rows.Count, 1)).EntireRow.Delete
.Range(.Cells(1, iLastCol + 1), _
.Cells(1, .Columns.Count)).EntireColumn.Delete
End With

End Su

--
Bob Phillip
-----------------------------------------------------------------------
Bob Phillips's Profile: http://www.excelforum.com/member.php...fo&userid=2695
View this thread: http://www.excelforum.com/showthread.php?threadid=47129

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset UsedRange tjtjjtjt Excel Programming 5 July 31st 05 02:46 PM
usedRange GC Excel Programming 2 March 31st 05 01:44 PM
usedrange Mike[_94_] Excel Programming 4 February 17th 05 03:59 PM
UsedRange Damien McBain Excel Programming 3 July 4th 04 01:55 PM
Help - How do I reset usedrange in excel 2000 Donald Parker Excel Programming 1 January 28th 04 03:50 AM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"