+ Reply to Thread
Results 1 to 3 of 3

Refresh active sheet before performing Macro

  1. #1
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Refresh active sheet before performing Macro

    Good day all,

    I have a macro that picks out rows of information based on the the word "CAR" being in the contents of one column in sheet "2012" & sends this information to another sheet "CARReport", row by row. The macro works but when I need to update the sheet it doesn't clear the original information, e.g. If there are no "CAR" reports I need it to clear the sheet, basically I need to perform a refresh before the macro performs?
    Help!
    Last edited by matrixpom; 10-01-2012 at 09:36 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Refresh active sheet before performing Macro

    Hi, matrixpom,

    from what I understood from your question (and I assume you have headers in row 1 from A1 to AZ1) try something like this prior to your original macro:
    Please Login or Register  to view this content.
    If there is only data you may try
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Refresh active sheet before performing Macro

    Hi Holger,

    I've tweaked Your first line to "Sheets("CARReport").Range("A1:AN1000").ClearContents" & it works perfectly,

    grazie mille Holger
    Ciao

    Marco

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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