+ Reply to Thread
Results 1 to 10 of 10

VBA Skipping lines of code.

Hybrid View

  1. #1
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,767

    Re: VBA Skipping lines of code.

    This should be somewhat quicker
    Sub namees()
    
       Dim Cl As Range
       Dim Ws1 As Worksheet
       Dim Ws2 As Worksheet
       
       Set Ws1 = Sheets("postcodes")
       Set Ws2 = Sheets("sheet3")
       
       With CreateObject("scripting.dictionary")
          For Each Cl In Ws1.Range("M1", Ws1.Range("M" & Rows.Count).End(xlUp))
             If Not .exists(Cl.Value) Then .Add Cl.Value, Nothing
          Next Cl
          For Each Cl In Ws2.Range("B1", Ws2.Range("B" & Rows.Count).End(xlUp))
             If .exists(Cl.Value) Then Cl.Offset(, 6).Interior.Color = 255
          Next Cl
       End With
       
    End Sub

  2. #2
    Registered User
    Join Date
    03-15-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    63

    Re: VBA Skipping lines of code.

    Fluff13,

    Ooo, I'll definitely try that. That is some new stuff I haven't come across yet. Thanks. And thanks everyone else for your help as well.
    Last edited by jeffreybrown; 02-17-2018 at 07:47 PM. Reason: Removed full quote!

+ 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] Is VBA skipping lines of code?
    By JonathanEngr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2018, 06:48 PM
  2. [SOLVED] Sub is skipping lines of code after Then statement
    By chavez982 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2012, 10:32 PM
  3. [SOLVED] How do I allow for skipping lines between dates??
    By n2music in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2012, 10:28 AM
  4. return results without skipping lines.
    By mjhopler in forum Excel General
    Replies: 2
    Last Post: 07-13-2010, 04:01 AM
  5. Copy a formula skipping lines
    By JapanDave in forum Excel General
    Replies: 3
    Last Post: 06-01-2010, 05:11 AM
  6. [SOLVED] Need help in numbering a column while skipping lines
    By Gary Reger in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2005, 06:10 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