+ Reply to Thread
Results 1 to 2 of 2

If Text exists, then run code

  1. #1
    Forum Contributor
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    376

    If Text exists, then run code

    Please Login or Register  to view this content.
    Right now the above code is running and working perfectly. I need to add a couple columns to the Vlookup part "Cells(rowstart, shipcol).Value = Application.VLookup(looktran, srchtran, 4, False)" but only want it to run if specific characters exist in what would be the cell "Cells(rowstart, dccol)"

    I have played around with this, and thing that I am close... but cannot figure out why I am getting an error on this...
    Please Login or Register  to view this content.
    Last edited by snuffnchess; 03-11-2020 at 07:39 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,275

    Re: If Text exists, then run code

    Hi snuffnchess,

    Set a breakpoint on your line of
    If InStr(2, (Range(rowstart & dccol).Value), "J") > 0 Then

    Run your code and click on "rwostart" & dccol" to see if they look like a range. Make sure it is looking at the correct worksheet or workbook. Go to the immediate window and try to do a
    Debug.Print Range(rowstart & dccol).Value
    and see what happens.

    Hope this helps.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say 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. [SOLVED] IF Exists or on Error Then - Skip Code- How to write code?
    By Jack7774 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2013, 06:45 PM
  2. Run Code If Worksheet Exists
    By heliskier89 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-30-2011, 04:55 AM
  3. a macro code to check exists of name or text in sql database
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2009, 12:16 AM
  4. if exists code
    By burgerboy2k6 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2007, 06:48 PM
  5. [SOLVED] Checking a text box to make sure a code exists in our SQL Server
    By Angelique Worrell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2006, 02:50 PM
  6. Code to see if Comment Exists
    By wardides in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-28-2005, 05:00 PM
  7. [SOLVED] Worksheets Exists Code...
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2005, 05:05 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