PDA

View Full Version : VBA works in one workbook but not another



markstro
07-26-2016, 08:06 AM
Good Day forum, I have two macro enabled workbooks using MS 2013 Excel with automatic formula calculation enabled.
Using the VBA below along with conditionally formatting the selected cell will be automatically highlighted up to the Row 1 and to the left to Col A with the formatting selected in the conditional formatting setup.

I've attempted to share this with a coworker and it appears as if the formula calculation is set to manual when it is set to automatic, F9 will enable the macro, but you have to press it every time when you select another cell. Works fine in my workbook but not the coworker.

How do you trouble shoot or solve this problem?

Private Sub Workbook_Open()
End Sub
Sub EnableEvents()
Application.EnableEvents = 1
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.ScreenUpdating = True
End Sub


CONDITIONAL FORMATTING FORMULA IS:
=OR(AND(CELL("row")=ROW(),COLUMN()<=CELL("col")),AND(CELL("col")=COLUMN(),ROW()<=CELL("row")))

markstro
08-03-2016, 08:53 AM
No takers on this issue, I can't seem to figure out why it works in one workbook and not another.

Paul_Hossler
08-03-2016, 08:55 AM
No takers on this issue, I can't seem to figure out why it works in one workbook and not another.


It's only been 47 minutes, and it's lunch time here

markstro
08-03-2016, 09:06 AM
I was referring to my original post on 7-26 is all

GTO
08-03-2016, 09:30 AM
...I've attempted to share this with a coworker and it appears as if the formula calculation is set to manual when it is set to automatic, F9 will enable the macro, but you have to press it every time when you select another cell. Works fine in my workbook but not the coworker.

How do you trouble shoot or solve this problem?



Hi there,

I am logging out, but thought to ask:

Are you actually looking at your partner's PC or are you just being advised that calculation is set to automatic. I just wonder if your co-worker is mistaken and his Excel has calculation set to manual...

Mark

markstro
08-03-2016, 10:47 AM
Verified automatic calculation is enabled. I have the same problem on my system with any new sheets.
Would converting from MS 2010 to 2013 cause any differences in VBA that was used in 2010 not being compatible in 2013?

markstro
08-04-2016, 04:25 PM
another forum suggestion: change "Application.ScreenUpdating = True" to "Calculate"
Did not work, still need to press F9 to enable macro.