I'm writing a VBA Add-in for a customer. I tested the code on my computer and a coworker's computer and it executed to perfection. However, when testing on the customer's computer, I get an error on this line
ActiveSheet.UsedRange.Offset(1, 0).Resize(ActiveSheet.UsedRange.Rows.Count - 1).Rows.Select
From what I've read, this may be due to the fact that .select
is used, however, I'm not quite sure what to substitute.
Below is the whole block:
ActiveSheet.UsedRange.Offset(1, 0).Resize(ActiveSheet.UsedRange.Rows.Count - 1).Rows.Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$G2>30"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16751204
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 10284031
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True
Any ideas as to why this error is occurring? The entire Sub
is quite lengthy, but I'd be happy to provide it if that would be helpful.