+ Reply to Thread
Results 1 to 2 of 2

Macro to automatically fill cells based on previous entries

  1. #1
    Registered User
    Join Date
    10-03-2008
    Location
    Slovenia
    Posts
    1

    Macro to automatically fill cells based on previous entries

    Hey guys!


    In my new job I have to work a lot in Excel. To make my question simple to understand I'll ask with a simple example:

    ColumnA ColumnB
    Jan 1
    Matej 2
    Renata 3
    Andrej 4

    If I have it like this, basically what I need is a macro that checks everytime I fill ColumnA if there is already a duplicate entry in the same column and fills the value of ColumnB accordingly. So if i write in ColumnA "Jan" that it would fill ColumnB next to it by 1. Or if I write "Renata" it would automatically fill the ColumnB next to it by 3.


    Thanks!
    Jan

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    formula

    Hi
    B5=IF(ISERROR(VLOOKUP(A5,$A$1:B4,2,FALSE)),B4+1,VLOOKUP(A5,$A$1:B4,2,FALSE)) Drag the formula down to the last entry.This will return the first match only.
    Ravi

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to address cells in the next column to selection
    By miles_muso in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2008, 07:34 AM
  2. create a simple macro that changes fill color
    By Niclas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2008, 05:13 PM
  3. Validating a cell based on entries from other cells
    By m.cain in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2007, 09:24 PM
  4. How to fill in Blank Cells with series?
    By floridagunner in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-21-2007, 03:32 AM
  5. Macro to hide columns based on contents of two cells
    By Korae13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2006, 12:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1