+ Reply to Thread
Results 1 to 15 of 15

coding for if condition

  1. #1
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    coding for if condition

    Hi,

    Can some one please help me on this:

    Column A Column B
    YP0629160051437 -SNG01540Q0045658
    NEFT RETURN SNG01540Q0045658

    In the above example data, the last ID's are matching, so I need out put as if the row 2 ID is existing in row 1 then row 1 first id (before high fun(-) sign) need to be printed in Column B of row 2.

    Can some one please help me on this.

    Regards,
    Vimala K

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: coding for if condition

    Attach a sample workbook showing what your expected output should be.

  3. #3
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: coding for if condition

    Here is the attachment.
    Attached Files Attached Files

  4. #4
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: coding for if condition

    Can you give more than a single example, enough data to show your typical data format.

  5. #5
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: coding for if condition

    I have 30k rows with combination of different id's out of which i gave my requirement in simple way. its hard for me to simplify the data to give an example. i am sorry.

  6. #6
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: coding for if condition

    can some one give me the logic to get the id for the requirement so that i can work on the rest of the coding.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: coding for if condition


    Hi !

    Attach a before workbook with all possible cases. According to this workbook, attach too an after workbook for expected result …

  8. #8
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: coding for if condition

    Hope this attachment helps you to explain my requirement
    Attached Files Attached Files

  9. #9
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: coding for if condition

    Much better. And in no way does your new sample match what you described in your initial post, hence the real sample requirement.

    I'm sure someone will now be able to help you.

  10. #10
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: coding for if condition

    Thank you so much

  11. #11
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: coding for if condition

    can some one please help me on this

  12. #12
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this …


    As a beginner starter (as all is yet in VBA inner help …) :

    PHP Code: 
    Sub Demo1()
            
    Dim R&, S$(), Rg As Range
            Application
    .ScreenUpdating False
        With ActiveSheet
    .UsedRange
            
    For 2 To .Rows.Count
                
    If .Cells(R4).Value "Debit" Then
                    S 
    Split(.Cells(R3).Value"-")
                    
    Set Rg = .Columns(3).Find("Invoice Reversed for " S(1), , xlValuesxlWhole)
                    If 
    Not Rg Is Nothing Then Rg(13).Value S(0)
                
    End If
            
    Next
        End With
            Set Rg 
    Nothing
            Application
    .ScreenUpdating True
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  13. #13
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Try this …

    ok will try and get back to you

  14. #14
    Forum Contributor
    Join Date
    07-23-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: Try this …

    Hi Marc,

    I have tried this code on my data. and my data is having 20k rows. but now i am facing the error as below:

    Run-time error 9:
    Subscript out of range.

    May i know how can i fix this error.

    regards,
    Vimala K

  15. #15
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: coding for if condition


    Try first with post #8 attachment …

+ 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] In need of help regarding combo box coding and button coding (Access form project)
    By mailblade in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-09-2016, 01:34 AM
  2. coding on condition formating
    By willy292 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2014, 06:19 AM
  3. [SOLVED] Vb macro coding for transpose - complete coding?
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-02-2013, 11:16 PM
  4. [SOLVED] Vb macro coding for transpose - complete coding?
    By Dharani Suresh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2013, 05:04 AM
  5. [SOLVED] CheckBox coding to work with ComboBox coding
    By JimExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2013, 12:23 PM
  6. Coding and Reverse Coding a Questionnaire
    By lorr3 in forum Excel General
    Replies: 2
    Last Post: 11-18-2012, 06:43 PM
  7. Implant macro coding into ASP coding
    By Sam yong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-15-2005, 06:05 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