+ Reply to Thread
Results 1 to 1 of 1

VBA to create a "note" or a few sentences based on specific cell values.

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    10

    VBA to create a "note" or a few sentences based on specific cell values.

    I have names and numbers throughout my worksheet. I would like to write a generic sentence or note, and based upon whether these fields are filled in, it'll fill in the blanks of the note. The note looks like this:

    Generic text that won't change - (This line will always be this, it'll never change)<br>
    1. A2, B1 B2, C2, D2 (Sometimes there will be just 1 item here, sometimes it may list out as many as 10)<br>
    2. A3, B1 B3, C3, D3 (In this example there are 3 total items included in this note)<br>
    3. A4, B1 B4, C4, D4 (This is the last line, no further info is available)<br>
    Generic text that won't change - Generic text that won't change - Balance will go from (N10) to (SUM OF N10+D2:D20)<br>
    ***If K2-H2 is 3 or less, end the stamp here. If this value is 4 or greater, continue below***
    Options: (this text will not change)<br>
    Text stating that if value in G2 stays the same, Program will increase by (K2-H2) months <br>

    **At this point, is there a way to have excel compare the values (they're all numbers less than 60) of H2 vs. (L2,M2,N2,O2,L4,M4,N4,O4,L6,M6,N6,O6,L8,M8,N8,O8) and with that comparison, if none of the values are greater than H2+3, stop. If values exist that are greater than H2+3, it uses conditional formatting to grab 3 of those cells listed that are the closest to H2 without going under it.

    For example:

    H2 = 20
    L4 = 21
    M4 = 23
    N4 = 26

    and create the followling lines of text

    Text stating if option L4 is chosen, program will increase by (L4-H2) months. <br>
    Text stating if option M4 is chosen, program will increase by (M4-H2) months. <br>
    Text stating if option N4 is chosen, program will increase by (N4-H2) months. <br>
    Last line of generic text (Will not change)

    If only 2 of those cells in the comparison are higher than 3 months more than H2 it'll just list the 2 of them. If there is only 1 cell higher than H2, it'll list that one.

    Could it generate that stamp on the same sheet of the workbook?

    Is this doable? Should I attach the worksheet for reference?
    Attached Files Attached Files

+ 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. Copying specific cells based on cell value "P" or "O" to sht1 or sht2
    By Ity007 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-01-2016, 07:53 AM
  2. Loop VBA code to create a pricelist based on input values in "Calculator" sheet
    By chevwayne1509 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2016, 04:49 AM
  3. Replies: 3
    Last Post: 04-14-2013, 11:53 PM
  4. [SOLVED] Sheets("Sheet2").Range("AA1") = "Note"
    By dcburkejr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2012, 04:10 PM
  5. Split cell values based on "," and "-" and format as shown below
    By Roop in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2012, 12:28 AM
  6. Replies: 2
    Last Post: 09-29-2010, 03:28 PM
  7. Replies: 1
    Last Post: 04-12-2007, 09:33 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