PC Review


Reply
Thread Tools Rate Thread

How to change where ctrl-End goes (last cell of spreadsheet)?

 
 
nomail1983@hotmail.com
Guest
Posts: n/a
 
      3rd Sep 2007
I imported a large amount of data, then used a recorded macro to clean
up the spreadsheet by deleting rows. But ctrl-End still goes to some
cell far beyond the lower-right of the current data.

How can I change where ctrl-End goes to?

I would appreciate both VBA and Excel keyboard instructions. I intend
to incorporate this into my clean-up macro. But I would like to be
able to do this manually sometimes.

 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      3rd Sep 2007
Assuming apart from values there were no formats in any rows/columns
below/to-right of those you deleted, unfortunately, the only way to reset
the 'Last cell' is to programmatically call .UsedRange, eg simply

ActiveSheet.UsedRange ' typically works but not in all scenarios

Manually the only way I know to reset the Last Cell is to save the file.

Regards,
Peter T

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I imported a large amount of data, then used a recorded macro to clean
> up the spreadsheet by deleting rows. But ctrl-End still goes to some
> cell far beyond the lower-right of the current data.
>
> How can I change where ctrl-End goes to?
>
> I would appreciate both VBA and Excel keyboard instructions. I intend
> to incorporate this into my clean-up macro. But I would like to be
> able to do this manually sometimes.
>



 
Reply With Quote
 
nomail1983@hotmail.com
Guest
Posts: n/a
 
      3rd Sep 2007
On Sep 3, 1:33 am, "Peter T" <peter_t@discussions> wrote:
> <nomail1...@hotmail.com> wrote:
> > How can I change where ctrl-End goes to?

> [....]
> ActiveSheet.UsedRange ' typically works but not in all scenarios


Works great for me. Just want I needed. Thanks much.

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBILg==?=
Guest
Posts: n/a
 
      2nd Oct 2007
I wrote this sub:

Sub ResetUsedRange()
ActiveSheet.UsedRange
End Sub

Then i place my cursor in the cell I want to be the end and execute the
macro and nothing changes. Ideas?


"(E-Mail Removed)" wrote:

> On Sep 3, 1:33 am, "Peter T" <peter_t@discussions> wrote:
> > <nomail1...@hotmail.com> wrote:
> > > How can I change where ctrl-End goes to?

> > [....]
> > ActiveSheet.UsedRange ' typically works but not in all scenarios

>
> Works great for me. Just want I needed. Thanks much.
>
>

 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      2nd Oct 2007
UsedRange is read-only. You need to enter something in the cell you
want to be the "end" to make it so.

Mark Lincoln

On Oct 2, 11:43 am, Mike H. <Mi...@discussions.microsoft.com> wrote:
> I wrote this sub:
>
> Sub ResetUsedRange()
> ActiveSheet.UsedRange
> End Sub
>
> Then i place my cursor in the cell I want to be the end and execute the
> macro and nothing changes. Ideas?
>
>
>
> "nomail1...@hotmail.com" wrote:
> > On Sep 3, 1:33 am, "Peter T" <peter_t@discussions> wrote:
> > > <nomail1...@hotmail.com> wrote:
> > > > How can I change where ctrl-End goes to?
> > > [....]
> > > ActiveSheet.UsedRange ' typically works but not in all scenarios

>
> > Works great for me. Just want I needed. Thanks much.- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBILg==?=
Guest
Posts: n/a
 
      2nd Oct 2007
Okay, so I enter something in the cell I wish to make the last cell and then
execute the sub and nothing happens. Am I missing something or how do you
"Make it so"?

"Mark Lincoln" wrote:

> UsedRange is read-only. You need to enter something in the cell you
> want to be the "end" to make it so.
>
> Mark Lincoln
>
> On Oct 2, 11:43 am, Mike H. <Mi...@discussions.microsoft.com> wrote:
> > I wrote this sub:
> >
> > Sub ResetUsedRange()
> > ActiveSheet.UsedRange
> > End Sub
> >
> > Then i place my cursor in the cell I want to be the end and execute the
> > macro and nothing changes. Ideas?
> >
> >
> >
> > "nomail1...@hotmail.com" wrote:
> > > On Sep 3, 1:33 am, "Peter T" <peter_t@discussions> wrote:
> > > > <nomail1...@hotmail.com> wrote:
> > > > > How can I change where ctrl-End goes to?
> > > > [....]
> > > > ActiveSheet.UsedRange ' typically works but not in all scenarios

> >
> > > Works great for me. Just want I needed. Thanks much.- Hide quoted text -

> >
> > - Show quoted text -

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      2nd Oct 2007
Normally the 'LastCell' is the intersection of the lower-most row and
right-most column that each contain data and/or some formatting. Row height
counts as a format for this purpose, however entire rows/columns of
identical formatting do not (except where they intersect). The last-cell
itself might be totally empty of both data and formats. The LastCell can be
selected by pressing Ctrl-End or referenced by .SpecialCells(xlLastCell).

Say currently the Last Cell is "J10", If columns "H:J" and rows 8:10 are
deleted (ie all data & all formats removed), one might reasonably expect the
LastCell to become "G7". But it doesn't, it remains as "J10".

Usually the LastCell can be 'corrected' to G7 with any use of .UsedRange, as
in the example I gave, which appears to work fine for the OP.

As Mark says UsedRange is Read-only, however it does serve to reset the used
range. Very occasionally it doesn't reset some worksheets where saving the
wb would.

Regards,
Peter T


"Mike H." <(E-Mail Removed)> wrote in message
news:8CD0A6F6-6395-485E-8214-(E-Mail Removed)...
> Okay, so I enter something in the cell I wish to make the last cell and

then
> execute the sub and nothing happens. Am I missing something or how do you
> "Make it so"?
>
> "Mark Lincoln" wrote:
>
> > UsedRange is read-only. You need to enter something in the cell you
> > want to be the "end" to make it so.
> >
> > Mark Lincoln
> >
> > On Oct 2, 11:43 am, Mike H. <Mi...@discussions.microsoft.com> wrote:
> > > I wrote this sub:
> > >
> > > Sub ResetUsedRange()
> > > ActiveSheet.UsedRange
> > > End Sub
> > >
> > > Then i place my cursor in the cell I want to be the end and execute

the
> > > macro and nothing changes. Ideas?
> > >
> > >
> > >
> > > "nomail1...@hotmail.com" wrote:
> > > > On Sep 3, 1:33 am, "Peter T" <peter_t@discussions> wrote:
> > > > > <nomail1...@hotmail.com> wrote:
> > > > > > How can I change where ctrl-End goes to?
> > > > > [....]
> > > > > ActiveSheet.UsedRange ' typically works but not in all scenarios
> > >
> > > > Works great for me. Just want I needed. Thanks much.- Hide quoted

text -
> > >
> > > - Show quoted text -

> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the color of the cell marquee when using Ctrl F Mark-Sydney Microsoft Excel Misc 3 14th Jan 2009 10:52 AM
Changing a cell value in a spreadsheet may not change the result. JAYH33 Microsoft Excel Misc 1 5th Dec 2007 08:10 PM
Making one cell change with each spreadsheet use? JM Microsoft Excel Misc 1 24th Feb 2006 06:29 PM
Change cell which is the spreadsheet End =?Utf-8?B?SGFpcnkgSHVyZGxlcg==?= Microsoft Excel New Users 5 16th Feb 2006 05:15 PM
How do I change the end cell (Ctrl end) in a excel spreadsheet? =?Utf-8?B?dHVzaw==?= Microsoft Excel Worksheet Functions 2 12th Dec 2005 11:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:47 PM.