Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Conclude new account number

I Have 4 Columns Table To Define Accounts Info
Col. A Account Name
Col. B Account Code ( Number )
Col. C Account Type ( If Main Or Nominal Account )
Col. D Account Parent
I Use Form To Add New Accounts Info With Combobox To Define/Chose
Account Parent & Other 3 Textbox For Same Other Account Info , What
I Need Is To Have ( Max Account Number + 1 ) From Account Group
Numbers In Account Number Textbox As Suggested New Account Number
When I Define In Combobox1 Account Parent , So What Suggested Userform
Code To Manage This Task .
As Example Suppose That I Add New Expenses Account To Operating
Expenses As Main Or Parent Account To These Accounts Category Such As
General Maintenance Expenses And The Last Account Number Added To That
Category Is 41210008 So I Have To Get In Account Number Textbox
41210009 As Suggested New Account Number .
Any Help Advance Appreciated .
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conclude new account number


As you highlighted in your request a text box is TEXT so you have to
perticulir in what insturction to use in getting the max value and
finding account numbers on the worksheet. I usually get a range object
for the location of the Account number like this

with Sheets"(sheet1")
LastRow = .Range("A" & rows.count).end(xlup).row
'note I assume ther is a header row
Set AccountRange = .Range("A1:A" & LastRow)


TextValue = me.combobox1.Text
NumValue = Val(texttValue)

'Get Max value of Accont numbers from worksheet
MaxVal = worksheetfunction.Max(AccountRange)


'Use this code to find an account number
'note find looks for the text value
set c = AccountRange.find(what:=textValue, _
lookin:=xlvalues,lookat:=xlwhole)
if c is nothing then
msgbox("Did not find Account : " & textVal)
else
msgbox("Found Account : " & textVal & " at cell : " & c.address)

end if
end with


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=175168

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Conclude new account number

On Feb 1, 2:43Β*pm, joel wrote:
As you highlighted in your request a text box is TEXT so you have to
perticulir in what insturction to use in getting the max value and
finding account numbers on the worksheet. Β* I usually get a range object
for the location of the Account number like this

with Sheets"(sheet1")
LastRow Β*= .Range("A" & rows.count).end(xlup).row
'note I assume ther is a header row
Set AccountRange = .Range("A1:A" & LastRow)

TextValue = me.combobox1.Text
NumValue = Val(texttValue)

'Get Max value of Accont numbers from worksheet
MaxVal = worksheetfunction.Max(AccountRange)

'Use this code to find an account number
'note find looks for the text value
set c = AccountRange.find(what:=textValue, _
lookin:=xlvalues,lookat:=xlwhole)
if c is nothing then
msgbox("Did not find Account : " & textVal)
else
msgbox("Found Account : " & textVal & " at cell : " & c.address)

end if
end with

--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=175168

Microsoft Office Help


Dear Joel
First Thanks For Your Quick Replay But I Am So Sorry Because Still
Not Helpful Maybe Because I Couldnt Explain Clearly So Ill Try To
Explain Again :
1- I Need To Add Account Info Consists Of 4 Info Through Userform
2- Userform Consists Of 4 Fields : Textbox1 To Put Account Name €“
Textbox2 To Put Account Number €“ Textbox3 To Put Account Type ( Main
Or Nominal Account ) €“ Combobox1 Related To Col. D In Data Table To
Chose From Combobox1 Account Parent ( Account Main Category Related
To ) .
3- I Need If I Chose Parent As Example €œ Fixed Assets €œ From Combobox1
οƒ*I Got In Textbox2 ((Max Account Number Existed Related To That Parent
Account €œFrom Account Numbers Col. B Data Table €œ) + 1) So If Max
Account Number Related To That Parent €œ Fixed Assets €œ Is 11011007 So
I Must See In Textbox2 110011008 As Next Available Number To Give It
To My New Account I Want To Add It .
4- I Remind That Data Table Source/Entry Data Designed As I Mentioned
In My Original Post .
Hop I Could Clarify My Problem .
Any Help Advance Appreciated .


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
Mask Account Number Need help Excel Discussion (Misc queries) 2 April 6th 10 10:27 PM
Insert Name based on the account number Vic Excel Discussion (Misc queries) 2 June 22nd 09 04:21 PM
How account duplicated number if condition is met? Jon Excel Discussion (Misc queries) 1 March 7th 09 04:38 PM
Validate an account number XP Excel Programming 8 August 7th 07 07:34 PM
I want to put a bank account number that begins with 00 in Excel. Kbrookfi Excel Worksheet Functions 1 March 9th 06 05:32 AM


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