Consulting

Results 1 to 5 of 5

Thread: Solved: Add to a Year if not formated as a number

  1. #1
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location

    Solved: Add to a Year if not formated as a number

    in cell C1 I have the text "Units 2005" and I want to create code that would put "Units 2006" in the next column. Is this possible?

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Use custom formatting. Format your cells as "Units" 0000 and enter numbers in the usual way A1 2005 B1 = A1+1
    Last edited by mdmackillop; 04-03-2007 at 10:49 AM. Reason: Sorry, just read the question title again!
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just drag the value across, it will increment.

  4. #4
    VBAX Master
    Joined
    Jun 2006
    Posts
    1,091
    Location
    MdMackillop,

    That works great, I would have never thought of that but one problem with that way is now I can't wrap the text - I ultimately want it to look like this

    Units
    2006

    If I have to I will put them in two seperate cells stacked on top of one another but I would prefer not to because it changes someother things.

  5. #5
    VBAX Mentor
    Joined
    Sep 2004
    Posts
    431
    Location
    Another way that should address your last problem .
    In A1 type Units (then press Alt/Enter) ant type 2005 then drag across.
    Last edited by ndendrinos; 04-03-2007 at 03:07 PM.
    Thank you for your help

Posting Permissions

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