Give this event code a try...
HOW TO INSTALL Event CodeCode:Private Sub Worksheet_Change(ByVal Target As Range) Dim Col As Range If Not Intersect(Target, Range("D:D,G:G,J:J")) Is Nothing Then For Each Col In Intersect(Target, Range("D:D,G:G,J:J")).Columns Col.EntireColumn.AutoFit Next End If End Sub
------------------------------------
If you are new to event code procedures, they are easy to install. To install it, right-click the name tab at the bottom of the worksheet that is to have the functionality to be provided by the event code and select "View Code" from the popup menu that appears. This will open up the code window for that worksheet. Copy/Paste the event code into that code window. That's it... whenever you type something in Column D, G or J, the column will be resize to fit the longest entry in that column.
Just so I understand your setup, are you saying that Columns D, G and J contain formulas and that you want the columns to resize when the cells the formulas reference get changed? If so, are all the cell referenced by the formulas on the same worksheet as the formulas themselves? If not, can you post one formula from each of your columns so that I can see what is being referenced?my only problem is that I am using this in a template macro and it doesn't take unless I hit enter. Any way to tack it into so that when the references calc it auto expands?
Just so I understand your setup, are you saying that Columns D, G and J contain formulas and that you want the columns to resize when the cells the formulas reference get changed? If so, are all the cell referenced by the formulas on the same worksheet as the formulas themselves? If not, can you post one formula from each of your columns so that I can see what is being referenced?