Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Macro with more than one output

Status
Not open for further replies.

Greedo

Technical User
Nov 17, 2002
19
JP
I have made a VB macro that has more than one output but I am having trouble getting the two outputs into the correct cells. I have one cell whose formula is =Function(A, B). That one works fine but the Function also needs to put data into a cell that is two cells to the right (ie, Function is supposed to output data to both B5 and D5 and only B5 gets anything). I get data from the spreadsheet using the line:

windim(Direction, Direction) = Sheet3.Cells(20, 2).Value

Or something similar but I can't get the macro to output data in a similar way. I hope this question is clear, if not, let me know.
 
Why don't you just use Excel and set the value of cell D5 =(B5)? If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 
Its been fixed- the problem is that what I was trying to do is actually impossible. I wanted to have a single macro output the results of two different but related calculations into two different cells. So your solution really wouldn't have done it. Thanks though.

For those of you watching at home: a single macro can't output into more than one cell. My solution was to just copy the first macro, change the name, and paste it into the 2nd cell with the output being the second thing I wanted. Does that make sense?
 
>a single macro can't output into more than one cell

Are you quite, quite sure about this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top