W
wizer186
I'm trying to create a macro which runs on an if/then statement. I don't
know VBA really at all, but I've been trying to piece together code from
around the net. I took this from a piece that does something entirely
different than what I want; when I plug in the values I need it doesn't work.
I'd like it to work more generally though, where I can put in "lineweight"
or what not into the right place and a value and it work.
My particular application is I want to look for a value called "contractors"
and if it's true I want that shape's outline to be dashed; otherwise (if the
value is false) then I want it solid. I'd appreciate any help with what I've
put together so far. It seems pretty simplistic to me and maybe that's why
it isn't working, but it's taken directly from a piece of code that DOES work
that isn't much more complicated...
Sub IfThen()
Dim ThisShape As Visio.Shape
For Each ThisShape In Application.ActiveWindow.Selection
If ThisShape.CellsU("Variable").ResultIU = True/False Then
Value = ThisShape.CellsU("Variable2").ResultIU
End If
Next
End Sub
know VBA really at all, but I've been trying to piece together code from
around the net. I took this from a piece that does something entirely
different than what I want; when I plug in the values I need it doesn't work.
I'd like it to work more generally though, where I can put in "lineweight"
or what not into the right place and a value and it work.
My particular application is I want to look for a value called "contractors"
and if it's true I want that shape's outline to be dashed; otherwise (if the
value is false) then I want it solid. I'd appreciate any help with what I've
put together so far. It seems pretty simplistic to me and maybe that's why
it isn't working, but it's taken directly from a piece of code that DOES work
that isn't much more complicated...
Sub IfThen()
Dim ThisShape As Visio.Shape
For Each ThisShape In Application.ActiveWindow.Selection
If ThisShape.CellsU("Variable").ResultIU = True/False Then
Value = ThisShape.CellsU("Variable2").ResultIU
End If
Next
End Sub