+ Reply to Thread
Results 1 to 7 of 7

VBA to analyse

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    VBA to analyse

    Hello,

    I am not sure if it can be done.. But what I am trying here is noted below.

    1. I have string of data in Column N and Column O
    2. If in Cell of Column N and Column O of same row has value #N/A, then I need adjustment cell P noted with " not available "
    3. If in any one Cell of Column N and Column O of same row has value #N/A, then I need VBA to do noting.
    4. If in both Cell of Column N and Column O of same row do not have value #N/A, then I need VBA to do nothing.?

    My header start from Row 5.

    Can it be done?

    Cross Posting
    HTML Code: 
    Thanks
    Last edited by shiva_reshs; 10-30-2013 at 12:19 PM.
    Keep the Forum clean :


    1. Use [ code ] code tags [ /code ]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. Show appreciation to those who have helped you by clicking * Add Reputation below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA to analyse

    How about just a formula?

    =if(and(isna(n2), isna(o2)), "not available", "")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to analyse

    Formula works, but can we tweak that into VBA??

    Thanks

  4. #4
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to analyse

    Finally i was able to get it done.

    Range("P6").Select
        ActiveCell.FormulaR1C1 = _
            "=IF(AND(ISNA(RC[-2]), ISNA(RC[-1])), ""not applicable"","""")"
          Application.CutCopyMode = False
        Selection.Copy
        ActiveCell.Offset(0, -1).Select
        Selection.End(xlDown).Select
        ActiveCell.Offset(0, 1).Select
        Range(Selection, Selection.End(xlUp)).Select
        ActiveSheet.Paste
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
      ''  Range("R6").Select
        Application.CutCopyMode = False
    Thanks shg.

  5. #5
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to analyse

    Hi Sgh,

    I want to extend your formula to another cell at the left..

    =IF(AND(ISNA(RC[-3]), ISNA(RC[-2]), ISNA(RC[-1]))), "Not Applicable","")
    Whats wrong with the code?

    Thanks

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA to analyse

    someCell.FormulaR1C1 = "=IF(AND(ISNA(RC[-3]), ISNA(RC[-2]), ISNA(RC[-1])), ""Not Applicable"","""")"

  7. #7
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to analyse

    thanks! Solved.

+ 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. VBA to Analyse a row of values
    By Macca_GB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2013, 01:38 PM
  2. VBA to Analyse a row of values
    By Macca_GB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-11-2013, 10:50 AM
  3. VBA to Analyse a row of values
    By Macca_GB in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 09-10-2013, 04:21 PM
  4. Analyse-It HELP
    By brantjes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2009, 01:39 PM
  5. Macro to analyse
    By karnali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2005, 07: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