Results 1 to 12 of 12

Thread: find with xlprevious not working

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location
    I downloaded and tested your file. Your code is finding merged cells ok as far as I noticed. Looks a little over complicated to me though.
    What are the address's of the merged cells is it missing?
    (My code also looks to me to be working ok in your file, after after I broadened the range to ActiveSheet.UsedRange.) - The reason I could take advantage of error handling is because my code is arranged differently than yours.

    While from what I observed your code is working, it is a best practice in most cases to add Option Explicit at the top of the module, so that you will be alerted to undefined variables and similar problems.

    All of the following variables in your code are undefined and should be. - Not defining the variables can make the code run inconsistently or differently on differently pc's, which might be what is happening to you.

    [vba]Dim RngTar As Range
    Dim RngCur As Range
    Dim RngNex As Range
    Dim I As Long
    Dim J As Integer
    Dim RowFr As Long
    Dim RowTo As Long
    Dim ColFr As Integer
    Dim ColTo As Integer
    Dim RowLas As Long
    Dim ColLas As Integer[/vba]
    Last edited by frank_m; 07-03-2011 at 04:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •