Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Sequence Question Again (Please Help)

Using VBA I want to know what Account code was last iputted (used) in
a given sequence within a column so the user know the next number to use
Users are inputting via userforms so cannot see the spreadsheet.
Therefore if column A as codes SAT1, SAT2, SAT3 etc I want to able via
a msgbx to notify the users that SAT3 was the last Account code to be
used and therefore user SAT4 should be used next.
Obviously this will only be used when the user hits a command button
titled next availble account.

Unfortunatley the code maynot be at the bottom or top because we have a
number of differenct code make-ups.

Many thanks fro trying

M




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Sequence Question Again (Please Help)

Did Tom's suggestion not help? If not, in what way?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mr M Walker" wrote in message
...
Using VBA I want to know what Account code was last iputted (used) in
a given sequence within a column so the user know the next number to use
Users are inputting via userforms so cannot see the spreadsheet.
Therefore if column A as codes SAT1, SAT2, SAT3 etc I want to able via
a msgbx to notify the users that SAT3 was the last Account code to be
used and therefore user SAT4 should be used next.
Obviously this will only be used when the user hits a command button
titled next availble account.

Unfortunatley the code maynot be at the bottom or top because we have a
number of differenct code make-ups.

Many thanks fro trying

M






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sequence Question Again (Please Help)

Mr M Walker,
In case you missed it, here it is again:

Dim rng as Range, nextNumber as Long
Dim i as Long, inum as Long, maxnum as long
maxnum = 0
set rng = Cells(rows.count,"A").End(xlup)
for i = rng.row to 2 step -1
inum = clng(right(cells(i,1),len(cells(i,1)-3)))
if inum maxnum then maxnum = inum
Next
nextNumber = "SAT" & maxnum + 1
msgbox nextNumber

--
Regards,
Tom Ogilvy



"Bob Phillips" wrote in message
...
Did Tom's suggestion not help? If not, in what way?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mr M Walker" wrote in message
...
Using VBA I want to know what Account code was last iputted (used) in
a given sequence within a column so the user know the next number to use
Users are inputting via userforms so cannot see the spreadsheet.
Therefore if column A as codes SAT1, SAT2, SAT3 etc I want to able via
a msgbx to notify the users that SAT3 was the last Account code to be
used and therefore user SAT4 should be used next.
Obviously this will only be used when the user hits a command button
titled next availble account.

Unfortunatley the code maynot be at the bottom or top because we have a
number of differenct code make-ups.

Many thanks fro trying

M








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
2 part macro question (sequence & order) Kevin Excel Worksheet Functions 5 March 1st 07 10:08 PM
sequence cesar Excel Discussion (Misc queries) 3 November 1st 06 03:33 AM
min and max in a sequence bill gras Excel Worksheet Functions 11 May 16th 06 11:33 PM
Set tab sequence help tamato43 Excel Discussion (Misc queries) 0 August 25th 05 07:11 PM
the first in a sequence Willem Excel Discussion (Misc queries) 2 May 12th 05 02:12 PM


All times are GMT +1. The time now is 08:28 PM.

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

About Us

"It's about Microsoft Excel"