Linking a Drop Down Cell with the Macro
Does this help:
Type your additional paragraphs in on the form, with all the possible extra
paragraphs in, each seperately in its own cell(s), don't worry that they
overrun the cell
Default is that all the possible paragraphs are visible.
Then use a check box from the forms toolbar, set control properties to say
cell z100.
If checked then it will say TRUE in this cell if selected.
Then use conditional formatting to make the text white if the value is TRUE
(set formula is =z100).Then your text will disappear if the box is ticked.
You can move the box around and call it what you want e.g. Is the shipment
Hazardous? They tick the box and the text appears.
The downside is you will end up with blank lines where your white paragraphs
are, so your form will end up long. Or you could use macro to hide the lines
with the unnecessary text, if for example you want it to print neatly without
big gaps
Sub Hide_rows()
'
' Macro1 Macro
' Macro recorded 23/06/2006 by robs
'Hide rows if check box is ticked
'
If Range("z100") Then
Rows("4:6").Select
Selection.EntireRow.Hidden = True
Else
End If
End Sub
This does it for one paragraph of 3 lines only, you would need to add more
This assumes you do the check box as above (no conditional formatting and
put the link to cell z100.
If the box is not checked the rows will be visible, if checked they are
hidden once the macro is run.
If you do both the above, then the paragraphs will disappear on screen as
soon as the box is checked, but the rows will not hide until the macro is run.
If you put button called print layout on your sheet, and get it to run the
macro above, then should make sure it all fits on a page, by hiding all the
unnecesary blank lines. If you want this could set print range and print it
as well
--
RWS
"white-ryland" wrote:
HI, I have that in place already on the form which the premium side, the
premium is inserted depending on the limit selected.
The example I gave was a very simple one, think this one is better:
I am wanting a different paragraph which appears depending on what is
selected from the list.
It is a form for an insurance quote and when eg they select, "hazardous good"
we have a hazardous Goods Clause" which I want to be inserted on the document.
There are several of these clauses.
Hope you can help?
RWS wrote:
Why use a Macro? If you use Data Validation to create a dropdown list of
names, and next to this use a second column for the positions, then use =a1&"
is the "&a2
where a1 is the drop down cell for Name and a2 is a vlookup returning the
value of the position i.e. =vlookup(a1,rangeoflists,2,false)
Does this help
Can anyone advise how I can get a Macro to start when eg "David" is selected
from the drop down cell?
[quoted text clipped - 10 lines]
Thanks.
|