+ Reply to Thread
Results 1 to 3 of 3

Conflicting VBA's: One for command buttons the other for conditional formats, no idea why?

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Question Conflicting VBA's: One for command buttons the other for conditional formats, no idea why?

    Hi All

    I'm hoping someone very clever can help
    I have 2 pieces of VBA that don't like to work at the same time on sheet4

    The first code (module4) works with conditional formatting to highlight cells with formulas:

    --------------------------------------------------------
    Function HasFormula(rCell As Range) As Boolean
    Application.Volatile
    HasFormula = rCell.HasFormula
    End Function
    --------------------------------------------------------

    The second piece is 3 macros for command buttons (module1).
    They hide/unhide columns depending on what view I need for data entry, and then place the cursor on the next available row

    --------------------------------------------------------
    Sub General()

    ActiveSheet.Range("B:P").EntireColumn.Hidden = False
    ActiveSheet.Range("F:F,H:K").EntireColumn.Hidden = True
    Range("B94").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Select

    End Sub
    etc
    --------------------------------------------------------

    For some reason making a workbook change will render the 3 command buttons useless?
    Likewise using the command buttons will knock the colour formatting out?

    By dumb luck I figured out if you hide a bunch of columns it'll get the command button macros working again, so as a workaround I've added a few extra lines of code to do this.

    But it's clunky. You have to click the command button twice to get them working again, at which point the colours disappear.... that is until you input some new info into the table, then the colours reappear but the buttons die again

    It's workable, but I'd love to know what's causing the conflict and how to fix it

    Many thanks to anyone who try's to solve this
    Vic
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Conflicting VBA's: One for command buttons the other for conditional formats, no idea

    Vic

    I can't seem to replicate the behaviour you describe, could you give some direction on how to do so?

    PS When posting code can you please use CODE tags?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-27-2012
    Location
    Uk
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Conflicting VBA's: One for command buttons the other for conditional formats, no idea

    Hi Norie
    Apologies will do in future.
    I've attached some screenshots at each step
    Attached Images Attached Images

+ 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. use a command button to click other command buttons
    By fcharl9 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2013, 08:48 PM
  2. Useform Code - 12 Command Buttons dependant on other command buttons
    By darrenkaye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2013, 10:58 AM
  3. Master Command Button to call on other Command Buttons located in other Workbooks
    By MrNickRegan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2013, 07:57 PM
  4. Code for a master command button to change the backcolor of multiple command buttons?
    By panttherm5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:11 PM
  5. Linking command buttons to option buttons
    By sealtite01 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-20-2012, 12:25 PM
  6. conditional formats any idea ?
    By kvok in forum Excel General
    Replies: 1
    Last Post: 04-29-2010, 06:20 AM
  7. Conflicting results going from Command button to Call routine
    By OverTheHill in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-17-2007, 05:00 AM
  8. [SOLVED] Conflicting Conditional Formatting
    By LMcK in forum Excel General
    Replies: 1
    Last Post: 03-01-2006, 04:20 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