+ Reply to Thread
Results 1 to 3 of 3

If statement - Line needed

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    If statement - Line needed

    I need to add something on each of the lines that have:

    HTML Code: 

    I need to add something to the end that if "42" is found it does the
    HTML Code: 
    and also skips all the other

    Sheets("sheet2").Range("L16").Select


    For b = 22 To 23
    Data = Mid(MyHost.Row(b), 1, 2)
    If Data = "42" Then
    ActiveCell.Value = Mid(MyHost.Row(14), 2, 4)
    Else
    ActiveCell.Value = Mid(MyHost.Row(14), 2, 4)
    RC = MyHost.Runcmd("DOWN")
    End If
    Next


    and picks up at
    HTML Code: 
    HTML Code: 

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: If statement - Line needed

    Hi mattress58,

    I am not sure i fully understand what you are asking but it seems that if you did something like this you may be heading in the right direction, see one example inside the *************** lines
    for example of how I have interpret your request

    Please Login or Register  to view this content.
    apologies if I am on the wrong path

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

  3. #3
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: If statement - Line needed

    Perfect. Thanks

+ 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 Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  2. Help needed on line graph..
    By mahershams in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-19-2012, 09:39 AM
  3. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  4. Replies: 1
    Last Post: 04-11-2012, 10:26 AM
  5. Line Numbers needed
    By covey9257 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2007, 11:43 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