+ Reply to Thread
Results 1 to 3 of 3

Range problem - I think

  1. #1
    Registered User
    Join Date
    02-05-2007
    Location
    Bristol, UK
    Posts
    5

    Range problem - I think

    I have the following piece of code for a command button on a sheet, and if I can get it to work as i would like, then I would like to replace it in a conditional format, but I though I would see if I could get the code to work before I added it to a conditional format.
    This works
    Please Login or Register  to view this content.
    But this only works if all cells in the Range meet the criteria in all cells
    Please Login or Register  to view this content.
    Also, if this is not possible to transfer to a conditional format please let me know as it's all new to me

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Yes, it can be used in conditional formatting. Just use Formula Is: =LEN(A1)<>8

    As for the code, you need a For Each statement:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-05-2007
    Location
    Bristol, UK
    Posts
    5
    Thank you SO much jasoncw. You don't know how long I have been tring to do this. I have spent ages trying to do it all by code until somebody mentioned conditional formatting.
    I had never heard of it before, being new to Excel and only self taught at VB (not VBA and there seems to be quite a difference )

    So, now I have this, I believe I have to make sure that the different arguements in conditional formatting are in the correct order.

    If, after entering data into a cell, if the row is now fully completed and no empty cells I want the first cell in column "A" to be formatted differently.
    Now, I can do the formatting, but if the user adds data to say D6, how do I take the row number and how do I find out how many columns there are?

    There are a set number of columns at the moment, but it could change in the future, so i don't want to hard code it.

    If you could point me in the right direction, but not necessarily give me all the code, as I am more likely to remember it if I work it out myself.

    that said, I am sure I will come back to you while doing this.

    The three stages, and in this order I think, would be:
    (1) To check if row was complete, if so cell in column "A" would be black back colour and white text'
    (2)To check if any cells were empty, if so make yellow back colour
    (3)If a yellow cell has data entered into it, to make it clear.

    I would have to check that the text input would fit the expected text, which I wan to be a date in the format "dd/mm/yy"
    I have the code to do this, but where Would this go, in the worksheet change?

    I know there is a lot there, but any help would be very gratefully received.

    Thanks

+ 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