+ Reply to Thread
Results 1 to 5 of 5

VBA Clear Misc Cells in Worksheets

  1. #1
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    43

    VBA Clear Misc Cells in Worksheets

    I have the following code in VBA that works. I have a sheet that needed cells to be clear when file is Opened. The VBA in "Green" clears the needed cell in my "Contact Info" Sheet. I tried to add another sheet "elevate Pricing" to clear cells in that and eventually others sheets. The VBA in "Red" is what I tried...but it ends in error with VBA "Blue" (Endif). Its not working...any suggestions?

    Steve

    Please Login or Register  to view this content.
    Last edited by StevenRK72; 03-06-2024 at 04:03 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VBA Clear Misc Cells in Worksheets

    Try 'activating' the sheet prior to taking any action.

    Sheets("Elevate pricing").Activate
    With Sheets ('elevate ....

  3. #3
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    43

    Re: VBA Clear Misc Cells in Worksheets

    I tried the following...but get a compile error at Endif "End if without block if"

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VBA Clear Misc Cells in Worksheets

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    43

    Re: VBA Clear Misc Cells in Worksheets

    Logit - Your code did the trick. I was able to clear req'd cells in 5 sheets! Thanks for your help!

    Steve

+ 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] Loop and find specific value or misc value, if misc then not equal to certain values
    By scott.s.fower in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2014, 09:28 PM
  2. Fill Across Workseets is greyed out
    By The Phoenix in forum Excel General
    Replies: 2
    Last Post: 01-02-2014, 11:35 AM
  3. Unhide Range of Workseets even if Visible
    By groundin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2013, 03:43 PM
  4. Check for duplicate entries between two workseets
    By itguy1981 in forum Excel General
    Replies: 21
    Last Post: 02-03-2012, 07:48 AM
  5. Replies: 3
    Last Post: 07-19-2010, 10:03 AM
  6. Moving Data Between Workseets
    By aces_up1504 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-06-2007, 06:41 PM
  7. How to create a view option (or hide/unhide preselected cells) (Repost from Misc)
    By Turquoise_dax in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2006, 03:50 PM
  8. Counting misc object in cells
    By Ntisch in forum Excel General
    Replies: 2
    Last Post: 01-03-2006, 09:57 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