value of a cell based upon column letter and variable for row#
Dim lngVar as Long
Dim sh as Worksheet, j as long, i as long
Dim varr as variant
lngVar = 2
set sh = worksheets("Daily")
varr = Array("A1","A9","D15","C30")
with Worksheets("Monthly)
j = 1
for i = lbound(varr) to ubound(varr)
j = j + 1
.Cells(lngVar,j).Value = sh.Range(varr(i)).Value
Next
End With
--
Regards,
Tom Ogilvy
Tod wrote in message
rver.com...
Please forgive the dumb question....
A user enters daily data into a worksheet. I need to create a macro that
inserts the daily values from that worksheet into a different worksheet
based
upon the value of a variable. The values from the daily worksheet are
from 3
or 4 columns and about 20 rows. They will all need to placed into cells
in
one row on the other worksheet. For example...
If variable equals 2
Daily Worksheet -- Monthly Worksheet
A1 -- B2
A9 -- C2
D15 -- D2
C30 -- E2
I am completely lost. Please help!
TIA,
Tod
|