+ Reply to Thread
Results 1 to 10 of 10

autofill column

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    96

    autofill column

    i want VBA code for column C to be auto filled cells with the word "Absent" if any cell is left blank.

  2. #2
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: autofill column

    mubashar, you could try something like this. You will need to determine how to limit the range of column C. This code assumes the whole column up to the last used cell in C is fair game.

    Greg

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-11-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: autofill column

    it doesnot work

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: autofill column

    You dont need VBA for this. You could use a simple =IF(A2="","Absent","") in C2, copied down. Adjust references to suite
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    04-11-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: autofill column

    i want , eg if cell c1 has value "OK" , i hit enter key, it goes to cell c2, does not write anything and hit enter key , selection goes to c3 cell leaving empty c2 cell. i want when i left any cell in column c blank , the work "Absent" automatically be written in it.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: autofill column

    OK thats different to your 1st request. You will need VBA for this

    Although another option mighht be to have "absent" in all cells, and then when you go to that cell, whatever you enter will replace that

  7. #7
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: autofill column

    The following code given by gsnidow works perfectly, what's problem? you should upload your worksheet for quick ref.
    Quote Originally Posted by gsnidow View Post
    mubashar, you could try something like this. You will need to determine how to limit the range of column C. This code assumes the whole column up to the last used cell in C is fair game.

    Greg

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: autofill column

    mubashar, I think this is more in line with what you want. Keep in mind, you have not given an input as to the limits of the range in column C, so, once again, I'm guessing. If it "does not work" again, then I would suggest you upload a sample workbook with data and comments, so we know *exactly* what you are needing to do.

    Greg

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: autofill column

    Maybe:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-11-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: autofill column

    thanks gsnidow and all others that help me. it is working nice

+ 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. [SOLVED] AutoFill the first emty column based on the values of the last filled column
    By runneer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2013, 01:04 PM
  2. Need help with Macro to autofill formula in Column B based on length of Column A
    By soxsrules in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2013, 02:43 PM
  3. Worksheet function to Autofill formula in column A when data entered in column B
    By boylers75 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 02:27 PM
  4. [SOLVED] VBA Code Required to autofill formulated column according to the adjacent column
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2012, 12:05 PM
  5. Copy/move a word from a cell in a column to another column and autofill
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2009, 03:54 PM

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