Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default value of a cell based upon column letter and variable for row#

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count letter"B" in one column based on unique value among duplicat Mero Excel Worksheet Functions 4 May 21st 09 12:26 PM
change order of 5 letter word based on another cell containing 5 numbers Forum Freak[_2_] Excel Worksheet Functions 5 July 19th 08 08:39 PM
How to replace column letter in refferences with a function using the old column letter? Dmitry Kopnichev Links and Linking in Excel 6 October 13th 05 09:09 AM
How to replace column letter in refferences with a function using the old column letter? Dmitry Kopnichev Excel Worksheet Functions 6 October 13th 05 09:09 AM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"