+ Reply to Thread
Results 1 to 28 of 28

try to Copy entire Row if active cell equals variable

Hybrid View

  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: try to Copy entire Row if active cell equals variable

    Hi Mfederman

    Welcome to the Forum.
    In future please view the forum rules before posting. Your post does not comply with rule #3.
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window.
    Would be ideal to see a sample workbook. Start with changing this line of code
    Range.Offset(0, -5)activecell.end (xltoright).Copy
    to
    Range.Offset(0, -5).EntireRow.Copy
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  2. #2
    Registered User
    Join Date
    04-25-2017
    Location
    Campton Hills, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: try to Copy entire Row if active cell equals variable

    VBA didn't like the Range.offset, so I changed it back to Activecell.offset and that got rid of my error there. Now I'm getting another error that is as follows.

    "Run-time error '91':
    Object Variable or with blocl variable not set"

    When I hit the Debug button, it highlights the like where I display the input box to set the variable.

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: try to Copy entire Row if active cell equals variable

    Are you wanting to copy all the rows that match the payroll input date to a new workbook.
    Your variable
    Dim payrolldate As Range
    is giving the error

  4. #4
    Registered User
    Join Date
    04-25-2017
    Location
    Campton Hills, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: try to Copy entire Row if active cell equals variable

    What should the payrolldate variable be then? Would it not be a range?

+ 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] Macro to search Active cell, then copy entire row & sort the list
    By teaboi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-08-2016, 09:50 AM
  2. [SOLVED] Return entire row if cell equals
    By Moedeb27 in forum Excel General
    Replies: 5
    Last Post: 08-03-2016, 07:28 PM
  3. Replies: 3
    Last Post: 07-16-2015, 09:29 AM
  4. [SOLVED] Copy Entire Row if Cell Value Equals X or Y or Z
    By TShelt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2014, 04:38 PM
  5. Replies: 1
    Last Post: 07-31-2013, 10:21 AM
  6. [SOLVED] Macro to Copy Entire Rows if Column Equals
    By Andrew.Trevayne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2012, 09:46 PM
  7. Copy Range to New Line - Save Active Cell to Temp Variable
    By ngay528 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2009, 05:00 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