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
Bookmarks