+ Reply to Thread
Results 1 to 6 of 6

VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    Accrington, England
    MS-Off Ver
    2003
    Posts
    3

    VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

    Hi guys,

    I have a spreadsheet with several sheets which I am having a few problems with. Basically I have set up the below code so that VBA will apply an autofilter which looks for a certain criteria in a column and then cuts and pastes the relevant row to the next sheet before deleting the row in the first sheet and moving the rows up. The criteria that the autofilter looks for is "Yes."

    Please Login or Register  to view this content.
    Basically the problem I am encountering is that when I click the update button, it cuts and pastes the column header as well as the update button into the next sheet which obviously I don't want it to do.

    Can anyone please point me in the right direction with this?

    Many thanks

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

    hi micropscotts, welcome to Excelforum

    Please Login or Register  to view this content.
    Last edited by watersev; 08-06-2014 at 08:25 AM.

  3. #3
    Registered User
    Join Date
    08-06-2014
    Location
    Accrington, England
    MS-Off Ver
    2003
    Posts
    3

    Re: VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

    hi micropscotts, welcome to Excelforum

    Please Login or Register  to view this content.
    Hi watersev,

    I added the above line of code to my VBA script and although this does omit the header line, it now only copies and pastes the cell which the autofilter is looking for data in (ie the data in the cells in column "n")

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

    Maybe Change:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-06-2014
    Location
    Accrington, England
    MS-Off Ver
    2003
    Posts
    3

    Re: VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe Change:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    That's cracked the little bugger! Awesome work John H Davis! Rep+1'ded

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Macro Code Problem - Cuts and Pastes Sheet Header - nightmare!

    You're welcome. Glad my 2 cents helped.

+ 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. Macro that cuts data from lower rows and pastes them in adjacent rows
    By kehl_4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2014, 02:07 PM
  2. Macro not working - Cuts and pastes rows of data from & into protected sheets
    By Christina75 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2012, 12:03 PM
  3. Odd paste problem, code pastes into wrong cell.
    By swoop99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2012, 11:03 AM
  4. I have a script in where it copies a sheet's data, and pastes it, but over pastes...
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2012, 02:20 AM
  5. How to stop #Ref! errors with macro that cuts and pastes from list
    By The Bantam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2009, 11:46 AM

Tags for this Thread

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