Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


I am looking for some help on a VBA

I am looking for some help on a VBA

I am looking for some help on a VBA

I am looking for some help on a VBA function that would do the following

1) I Have a table that has one of the fields that has multiple values (Field1). An adjoining field is called ranking and it has null values. Thus for instance the value 411 could be repeated 2, or 3 times in Field1
2) I want the Function, or Procedure to look at the first value in Field1 and assign a 10 in the Ranking field. If there are more than one record with the same value (411) it would go to the second record and assign an increment of 10. So the second record with the value 411 in Field1 would have 20.
3) If the third record is, say 412, the ranking filed would reset to 10 and follow the same logics as in (2) above.

Thanks for your help

RE: I am looking for some help on a VBA


Here's my test table...

Field1	Field2
411	10
411	20
411	30
412	10
412	20
413	10
414	10
414	20
414	30
414	40

Formula in B2...

B2: =IF(A2=A1,B1+10,10)

...and copy/paste down.

So why use a program when a simple formula will suffice?


glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: I am looking for some help on a VBA

Thanks Skip. That's the exact formula that I am using in EXCEL. However I want to emulate that function in Ms ACCESS. Any suggestions?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close