+ Reply to Thread
Results 1 to 7 of 7

Reformat using If statment based on cell format

  1. #1
    Registered User
    Join Date
    03-13-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Reformat using If statment based on cell format

    Hi folks,
    The problem I’ve got essentially comes down to formatting. The data used in my spread sheet, which I have no control over. When the data is pasted across it has the ‘number stored as text’ error so I am reformatting the column. However this is taking awhile on my work PC for I was trying to add an if statement to check if the format is correct.

    Please Login or Register  to view this content.
    The problem is that my if statement runs no matter what. No doubt I’m missing something very obvious but I can’t find the correct format identifier. I have tried types like isnumeric but it still runs through the if (even when in the correct number format).
    Also, on a side note, ideally I would like the range to adapt to populated cells, the problem is that in some cells the value is blank and that is correct. Ideally I’d like to link to column A which will always be populated but can’t find the correct thread. Any and all help is greatly appreciated.
    Last edited by aiszeebee; 03-16-2012 at 04:33 AM. Reason: sloved

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Reformat using If statment base on cell format

    Does this do what you want?
    Please Login or Register  to view this content.
    Beware, the moderators will be on your case for not following the rules... Edit your post and use code tags.

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Reformat using If statment base on cell format

    @dangelor, the moderators might get on your case as well for answering a question that does not follow forum rules.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Reformat using If statment base on cell format

    @Mordred... wouldn't be the first time.

  5. #5
    Registered User
    Join Date
    03-13-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Reformat using If statment based on cell format

    Many Thanks Guys.
    Hopefully I am within the rules now. dangelor - I am just going to try the code and will let you know ASAP.
    Cheers

  6. #6
    Registered User
    Join Date
    03-13-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Reformat using If statment based on cell format

    Thank you. I have tested with 2 different data set and works great and about 1000 times quicker then what I was trying to to. I guess its easy when you know how.
    Thanks again

  7. #7
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Reformat using If statment based on cell format

    Learned the same way. Glad to help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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