Results 1 to 4 of 4

Looping VBA code for Goalseeking skipping certain named sheets

Threaded View

  1. #1
    Registered User
    Join Date
    08-20-2018
    Location
    New york
    MS-Off Ver
    2016
    Posts
    21

    Looping VBA code for Goalseeking skipping certain named sheets

    Hi!

    I tried to do something like this a year ago or so but it never quite came out how originally planned it and now its more important that I get it right.

    I have a master sheet with data that references many sheets in the same wb. On each of the many sheets I need one cell to be goalseeked to zero. Right now I have the following few lines of code on each sheet that requires goalseeking:


    [
    Private Sub Worksheet_Calculate()
    Application.EnableEvents = False
    Range("D4").GoalSeek Goal:=0, ChangingCell:=Range("C13")
    Application.EnableEvents = True
    End Sub]
    This was sufficient for a while but what I need now is a looping code I can activate with a button. One that goes through each sheet in the wb but skips certain named sheets.

    or even better...

    Is it possible that if I had a list of the names of the certain sheets that I wanted the code to run on that if I selected this list of names and ran the code it would only run on those sheets?

    your help is appreciated.

    Thanks,

    G
    Last edited by Pepe Le Mokko; 01-30-2020 at 03:42 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Code skipping columns while formtting sheets.
    By shiva_raj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2019, 07:40 AM
  2. Expanding code from working on one named sheet to multiple named sheets
    By BryanD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2014, 01:26 PM
  3. [SOLVED] ThisWorkbook code not hiding named sheets
    By neelie777 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2014, 06:11 PM
  4. Looping Mutliple Named Resized Ranges in next empty row below another named range
    By gingumdog in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2014, 08:15 PM
  5. [SOLVED] Looping through named sheets
    By vexel77 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-26-2013, 10:43 AM
  6. [SOLVED] Goalseeking, help with percentage
    By Buster^ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2013, 05:50 PM
  7. [SOLVED] Looping through sheets to perform code
    By sambuka in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-30-2012, 03:25 PM

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