+ Reply to Thread
Results 1 to 5 of 5

Failing to write a search and cut and paste macro

Hybrid View

top_dog Failing to write a search and... 03-17-2014, 03:08 AM
nilem Re: Failing to write a search... 03-17-2014, 03:28 AM
top_dog Re: Failing to write a search... 03-17-2014, 04:17 AM
nilem Re: Failing to write a search... 03-17-2014, 04:35 AM
top_dog Re: Failing to write a search... 03-17-2014, 04:50 AM
  1. #1
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Failing to write a search and cut and paste macro

    Hi top_dog,
    try it
    Sub ertert()
    Dim s$, r
    Application.ScreenUpdating = False
    With Sheets("Data").Range("A1").CurrentRegion
        .Parent.AutoFilterMode = False: s = "~"
        For Each r In .Offset(1).Resize(.Rows.Count - 1).Columns(2).Value
            If InStr(s, "~" & r & "~") = 0 Then
                If Not Evaluate("ISREF('" & r & "'!A1)") Then
                    Sheets.Add(after:=Sheets(Sheets.Count)).Name = r
                Else
                    Sheets(r).UsedRange.ClearContents
                End If
                .AutoFilter 2, r
                .Copy Sheets(r).Range("A1")
                s = s & r & "~"
            End If
        Next
        .AutoFilter
    End With: Application.ScreenUpdating = True
    End Sub

  2. #2
    Registered User
    Join Date
    02-25-2014
    Location
    Auzzie
    MS-Off Ver
    Office 365
    Posts
    57

    Re: Failing to write a search and cut and paste macro

    Man you did that so quick! Is there anyway to make it not make new tabs and use the ones I have already?

    Many Thanks nilem, you have saved me so much headache.

+ 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] paste.special is failing
    By Barking_Mad in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2014, 08:03 AM
  2. [SOLVED] How to write Macro that could cut and paste data
    By ims0phie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2013, 11:34 AM
  3. Replies: 2
    Last Post: 02-17-2012, 03:08 AM
  4. Search or lookup function... attempting and failing
    By jhubbzwhat in forum Excel General
    Replies: 4
    Last Post: 10-15-2008, 11:03 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