#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro Query

Hi all,
I am wondering how to do this, I need to have a macro look up the max value
in column a on sheet2 and then give the total plus 1 in textbox1
I tried this but I cant get
Private Sub UserForm_Activate()

TextBox1.Value = Max(ActiveSheet.Range("a1:a50000") + 1)


End Sub

thanks

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro Query

Private Sub UserForm_Activate()
TextBox1.Value = Application.Max(ActiveSheet.Range("a1:a50000") + 1)
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Greg B" wrote in message
...
Hi all,
I am wondering how to do this, I need to have a macro look up the max

value
in column a on sheet2 and then give the total plus 1 in textbox1
I tried this but I cant get
Private Sub UserForm_Activate()

TextBox1.Value = Max(ActiveSheet.Range("a1:a50000") + 1)


End Sub

thanks

Greg




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro Query

Thanks for that Bob

Greg
"Bob Phillips" wrote in message
...
Private Sub UserForm_Activate()
TextBox1.Value = Application.Max(ActiveSheet.Range("a1:a50000") + 1)
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Greg B" wrote in message
...
Hi all,
I am wondering how to do this, I need to have a macro look up the max

value
in column a on sheet2 and then give the total plus 1 in textbox1
I tried this but I cant get
Private Sub UserForm_Activate()

TextBox1.Value = Max(ActiveSheet.Range("a1:a50000") + 1)


End Sub

thanks

Greg






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Macro Query

TextBox1.Value = Application.Max(ActiveSheet.Range("a1:a50000") )+ 1

"Greg B" wrote:

Hi all,
I am wondering how to do this, I need to have a macro look up the max value
in column a on sheet2 and then give the total plus 1 in textbox1
I tried this but I cant get
Private Sub UserForm_Activate()

TextBox1.Value = Max(ActiveSheet.Range("a1:a50000") + 1)


End Sub

thanks

Greg



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
Macro Query carla 7 Excel Discussion (Misc queries) 5 July 31st 08 04:07 PM
another macro query - deleting a worksheet within a query DavidHawes Excel Discussion (Misc queries) 2 February 26th 07 10:05 AM
NEW WEB QUERY MACRO A.J Setting up and Configuration of Excel 0 July 24th 05 04:31 AM
Query Macro Steve Excel Programming 7 May 19th 05 05:10 AM
Macro with Query Dick Kusleika[_3_] Excel Programming 0 July 29th 04 11:06 PM


All times are GMT +1. The time now is 01:29 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"