D
Don Johnson
I have a macro where I am pulling data from numerous worksheets in a single
workbook to approximately 200 variables that are not written anywhere on a
spreadsheet. Now I am near the end of my macro and want to record the
variables to a spreadsheet if it passes some logical tests. Below is a very
simplified example of my problem.
Dim ccy1 As Currency
Dim ccy2 As Currency
Dim varOutput As Variant
Dim intCounter As Integer
Dim strFormula As String
'There is no relationship between the values in ccy1 and ccy2
ccy1 = 3
ccy2 = 6
For intCounter = 1 To 2
strZ(intCounter) = "ccy" & Right(Str(intCounter), 1)
Next intCounter
' thus giving me strZ(1) = "ccy1" and strZ(2) = "ccy2"
'Now I want to the write the values of ccy1 and ccy2 to a spreadsheet so
cell 3
'"A1" = 3 and "A2" = 6 using some permutation of strZ(intCounter)
For intCounter = 1 To 2
Cells(intCounter,1).Formula = ? strZ(intCounter)
Next intCounter
I thought I had done this before but I can't seemed to come up with a
solution now.
Any suggestions?
workbook to approximately 200 variables that are not written anywhere on a
spreadsheet. Now I am near the end of my macro and want to record the
variables to a spreadsheet if it passes some logical tests. Below is a very
simplified example of my problem.
Dim ccy1 As Currency
Dim ccy2 As Currency
Dim varOutput As Variant
Dim intCounter As Integer
Dim strFormula As String
'There is no relationship between the values in ccy1 and ccy2
ccy1 = 3
ccy2 = 6
For intCounter = 1 To 2
strZ(intCounter) = "ccy" & Right(Str(intCounter), 1)
Next intCounter
' thus giving me strZ(1) = "ccy1" and strZ(2) = "ccy2"
'Now I want to the write the values of ccy1 and ccy2 to a spreadsheet so
cell 3
'"A1" = 3 and "A2" = 6 using some permutation of strZ(intCounter)
For intCounter = 1 To 2
Cells(intCounter,1).Formula = ? strZ(intCounter)
Next intCounter
I thought I had done this before but I can't seemed to come up with a
solution now.
Any suggestions?