Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Help with MAX code

Can anyone help me with this code:

Sub Macro10()
' Macro recorded 7/07/2006 by Corey
Range("R59").Select
ActiveCell.FormulaR1C1 = "=MAX('1:" & _
Worksheets(Worksheets.Count).Name & _
"'!R[-8]C[-10])" ' <============= I dont understand this bit here.... What
it does
Range("J59").Select

End Sub

When i place a value in Cell R59, then click a button to run the macro, the
value dissapears and the cell J59 is selected but nothing pasted there.

I want the MAX value of ALL sheets to be displayed in cell R59 regardless of
what worksheet is being viewed.

And this value (plus 1)placed in cell J59, if i run the macro.


EG.


R59 = 100150

Click button to run macro10

Copies R59 adds 1(100151)

Pastes it into J59

If the MAX value cannot be displayed unless a macro is run i don't mind, so
long as the final result is the MAX value+1=J59


Any help appreciated.

Corey


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with MAX code


Hello Corey,

Maybe this will help. This is what your macro is doing...

1. Select cell R59 on the active sheet.
2. Set R59's formula = MAX("1:" & "last worksheet's name!" & H51's
value)
3. Select J59 on the active sheet.

When using the MAX worksheet function, if an argument is an array or
reference, only numbers in that array or reference are used. Empty
cells, logical values, or text in the array or reference are ignored.
You don't indicate if your checking a range of cells or an array on the
worksheet, so I can only guess what you're after. Hope this helps.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=559194

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Help with MAX code

OK,
Almost there now.

The code I have now that finds the MAX value of ALL sheets and places it in
Cell R59.

Sub Macro10()
' Macro recorded 7/07/2006 by Corey
Range("R59").Select

ActiveCell.FormulaR1C1 = "=MAX('Enter-Exit Page:" & _
Worksheets(Worksheets.Count).Name & _
"'!R[0]C[-8])"


End Sub

The ONLY thing i want to modify now is:

HOW DO I ADD (1) to this value found and displayed in Cell R59?

I tried :
ActiveCell.FormulaR1C1 = "=MAX('Enter-Exit Page:" & _
Worksheets(Worksheets.Count).Name & _
"'!R[0]C[-8])" +1


But get an error.

???

Corey....






"Leith Ross" wrote
in message ...

Hello Corey,

Maybe this will help. This is what your macro is doing...

1. Select cell R59 on the active sheet.
2. Set R59's formula = MAX("1:" & "last worksheet's name!" & H51's
value)
3. Select J59 on the active sheet.

When using the MAX worksheet function, if an argument is an array or
reference, only numbers in that array or reference are used. Empty
cells, logical values, or text in the array or reference are ignored.
You don't indicate if your checking a range of cells or an array on the
worksheet, so I can only guess what you're after. Hope this helps.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=559194



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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
Create a newworksheet with VBA code and put VBA code in the new worksheet module ceshelman Excel Programming 4 June 15th 05 04:37 PM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM


All times are GMT +1. The time now is 12:01 AM.

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"