Target.Address wont triger AutoFit code in Excel 07

Cheek

New Member
Joined
Dec 1, 2010
Messages
11
Hi, Im trying to get rows to autofit every time cell b5 changes. Tried several things but still can't figure it out. Thanks

In Cell b5, there is a drop-down list via data validation. The data in the range of B10:E61 will automatically change referencing to the same location of another worksheet specified in the drop-down list of b5.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$b$5" Then
Rows("10:61").Select
Rows("10:61").EntireRow.AutoFit
End If
End Sub


Thanks

progress.gif
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,221,527
Messages
6,160,342
Members
451,638
Latest member
MyFlower

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top