+ Reply to Thread
Results 1 to 15 of 15

VBA help needed to Fill cell values based on Adjacent Cell values

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    VBA help needed to Fill cell values based on Adjacent Cell values

    Folks,

    I request you to write a code for me to fill the cell values as "Not Applicable" in Column "AZ", if the "B" Column cell values = "Justified", "Approved LSAR" & "Approved SDAR".

    I have attached the work book of what I am trying to accomplish.


    Thanks in advance for your time and expertise.

    Joshi
    Attached Files Attached Files
    Cheers,

    Joshi
    Being with a winner makes you a winner

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Is this an OR or And statement?

    All options need to be forfilled, or 1 of the options result in the text "Not Applicable"
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    OR statement...

    LIKE : =IF(OR(B1=""Justified", B1="Approved LSAR", B1= "Approved SDAR") then the returns should be "Not Applicable"
    Last edited by krjoshi; 06-05-2014 at 06:38 PM.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    No need for VBA

    You where on the right track.


    =IF(OR(B2="Justified",B2="Approved LSAR", B2= "Approved SDAR"),"Not Applicabl","other text")
    and drag down

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    oeldere,

    I need a VBA code since this sheet contains huge data and the row data will vary always. And I don't want drag down the formula all the times. I have the below partial code already, please help me to fix these.

        Dim columnValues  As Range, i As Long
        Dim cellstart As Integer
        Dim cellend As Integer
        cellstart = 2
        cellend = ActiveSheet.Range("B" & ActiveSheet.Rows.Count).End(xlUp).Row
    
        i = 1
    
        For i = cellstart To cellend
            If Cells(i, 2).Value = "Justified*" Then '<------ PLEASE HELP ME TO ADD ANOTHER TWO MORE CONDITION HERE
                Cells(i, 52).Value = "Not Applicable"
            End If
        Next i
    Thanks,
    Joshi

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Non VBA solution.

    In that case make an table of your data.

    After that use the formula I provided and it will expand to the last row of your table.

  7. #7
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Oeldere,

    Can you please help me to modify my existing code to fix this?

    OR Someone please help me...pleaseeeeeeeeeee

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Hi Joshi

    How does Column B get changed/updated?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    with an table and the given formula.

    see the attached file.

  10. #10
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Hi John,

    Column B will have a drop down list to select these values. Hence the cell value in Column B will be unique all the time.

    Thanks,
    Joshi

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    and my solution in #8?

  12. #12
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Oeldere,

    I don't want any formula in AZ Column. Since there also will be some manual entries

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Try the attached.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    What manual entries will be in column AZ?

    In which cells?

    Under which conditions?

  15. #15
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA help needed to Fill cell values based on Adjacent Cell values

    Thank you so much AB33, this what I was looking for.

    Oeldere and jaslake, thank you also for your reply, suggestions and help.

+ 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] Generating values in number of cells based on adjacent cell values
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-24-2014, 04:34 PM
  2. [SOLVED] copy cell values in one cell based on value of adjacent cells
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2014, 08:48 AM
  3. VBA help needed to fill cell values (offset values) by matching various conditions
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2013, 02:14 PM
  4. [SOLVED] Adding values based on value of adjacent cell...
    By Finalfrontier1976 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2013, 09:20 AM
  5. [SOLVED] Calculations based on adjacent cell values
    By Jack in forum Excel General
    Replies: 4
    Last Post: 06-10-2006, 09:45 AM

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