Find last cell "=INDEX(G:G,MATCH(9.99999999999999E+307,G:G))

mapakunk

New Member
Joined
May 7, 2002
Messages
40
I have a spreadsheet that I would like to assign a macro to. So that when I click it it will automatically auto sort a certain column. I am new to this so go easy on me please :oops:
This message was edited by mapakunk on 2002-05-14 05:45
This message was edited by mapakunk on 2002-05-14 06:00
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
First, you need to name the column, under Insert/Name/Define.

Then start to record your macro.
1st step - Edit/Go To/ type in column name
2nd step - Data/Sort/whatever order you want
Stop macro.

Then add a button to the worksheet via View/Toolbars/Forms/select the button and draw on sheet. When asked to assign a macro, select the one you just recorded.

Thie above only works if the column of data is always the same size. If you want a dynamic range, the Define Range formula needs to be based on the OFFSET function.

Hope this helps.

Nobby
 
Upvote 0
That works perfectly!!

Now, how do I rename it from "Button 27" to
"Outstanding Checks" then I can use this principle from here in all my wonderful spreadsheets. Hee hee hee hu ah ha ha haaaaaaaaaa! :LOL:
 
Upvote 0
Now one last thing, how can I make a formula that returns the last whole value in column G to a specific cell on the worksheet (look for last entry, then send cell x to c4?)
This message was edited by mapakunk on 2002-05-14 05:46
 
Upvote 0
On 2002-05-09 08:52, mapakunk wrote:
Now one last thing, how can I make a formula that returns the last whole value in column G to a specific cell on the worksheet (look for last entry, then send cell x to c4?)
This message was edited by mapakunk on 2002-05-14 05:46

If G is of numeric type:

In C4 enter:

=OFFSET(G1,MATCH(9.99999999999999E+307,G:G)-1,1,1)

If G is of alphanumeric type:

=OFFSET(G1,MATCH(REPT("z"80),G:G)-1,1,1)

The second formula will ignore the last cell having a formula-generated blank.

Aladin
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top