Hi
I have a form control ListBox with some options in it. It is linked to A1 cell.
I have following code in sheet code. I want the autofit code triggered each time there is change in A1 cell
I want to call Macro called "Autofit" from module which is as follows:
But nothing happens when the cell value changes.
Am I doing anything wrong?
Thanks in advance!
Sumant
I have a form control ListBox with some options in it. It is linked to A1 cell.
I have following code in sheet code. I want the autofit code triggered each time there is change in A1 cell
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Call autofit
End If
End Sub
VBA Code:
Sub autofit()
Worksheets("Launch Dates").Range("I8:I36").Columns.autofit
End Sub
But nothing happens when the cell value changes.
Am I doing anything wrong?
Thanks in advance!
Sumant