Vlookup help required
Maybe you can tie into that worksheet's calculation event to resize the rows.
If you want to try, right click on the worksheet that should have this
behavior. Select View code. Paste this into the code window:
Option Explicit
Private Sub Worksheet_Calculate()
application.enableevents = false
Me.Rows.AutoFit
'or be specific
Me.Rows("1:33").AutoFit
application.enableevents = true
End Sub
Changing the rowheight in some versions of excel (xl2003+, IIRC) will cause the
excel to want to recalc again. The .enableevents stuff stops excel from going
into a loop--recalc, loop, recalc, loop, ....
Zak wrote:
Hi,
I have a simple vlookup which is used to pull across data.. so i have one
cell which has a drop down list, the user selects something from there - a
cell a few rows down is auto populated with the required data depening on
what was selected from this first cell (what would be pulled across is a list
(small or big)).
I think i have a simple problem here - i want the cells to auto-fit to the
contents of the cell, for example, i am finding if the vlookup brings across
a long list then the cell doesnt change size to fit all the text (doesnt wrap
text) and instead the user has to manually change the size or have it
permanently big, which isnt very nice.
is there a formula or an extention to the vlookup or any other way i can do
this?
please help. thanks.
--
Dave Peterson
|