+ Reply to Thread
Results 1 to 4 of 4

Skip asterics (*) in module

Hybrid View

  1. #1
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Skip asterics (*) in module

    Hi guys,

    I'm bumping with my code at a cell which contains an asterisk. The code clears content of criteria FIND "pp" in column J and the first characters in column E.

    Sub Code()
    
        Dim l As Long
        Dim lRow As Long
        Dim strTest As String
        
        Application.ScreenUpdating = False
        
           
            Range("E7").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.NumberFormat = "0"
        
        lRow = Range("A65536").End(xlUp).Row
        
        For l = 2 To lRow
            If Range("J" & l).Value = "PP" Then
                strTest = Range("E" & l).Value & "*"
                Range("E" & l).Offset(1, 0).Select
                Do Until Not ActiveCell.Value Like strTest
                    ActiveCell.Offset(0, 6).ClearContents
                    ActiveCell.Offset(1, 0).Select
                Loop
            End If
        Next l
        
    End Sub
    Does someone has a workaround?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Skip asterics (*) in module

    Try using:
    strTest = Replace(Range("E" & l).Value, "*", "[*]") & "*"
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Skip asterics (*) in module

    Quote Originally Posted by romperstomper View Post
    Try using:
    strTest = Replace(Range("E" & l).Value, "*", "[*]") & "*"
    Worked perfectly : ) thanks (bedankt) a lot mister Romperstomper

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Skip asterics (*) in module

    graag gedaan.

    Please remember to mark the thread solved using the Thread Tools link at the top of the page.

+ 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] Code locks cells when inserted in sheet module but returns error in standard module
    By yoda66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 07:39 AM
  2. Replies: 1
    Last Post: 08-30-2011, 02:23 AM
  3. how to access Sheet module, normal module, Worbook module to type code
    By alibaba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2009, 07:51 AM
  4. Replies: 2
    Last Post: 03-27-2009, 11:48 AM
  5. Replies: 1
    Last Post: 04-10-2005, 07:07 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