View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default populating cells using data from a different worksheet

I don't think you need VBA instead do with formulas in Excel
I would have 3 worksheets labled Table,Scores, and Interpretation
Note the numbers 3,7, and 11 in 1st worksheet
Also empty cells in Column A in 2nd and 3rd worksheets. the blank cells in
column A lets all the data allign on the 3 sheets. I had to add the number
3,7, and 11 to get Vlookup to work

Table worksheet
A B C D E F thru L same as
previous

1 3 A-Low B-Low C-Low D-Low


2 7 A-Med B-Med C-Med D-Med


3 11 A-Hi B-Hi C-Hi D-Hi



Scores
A B C D E F thru L same as
previous

1 Scores Scores Scores Scores


2 Scores Scores Scores Scores


3 Scores Scores Scores Scores


Interpretation
A B C D E F thru L same as
previous

1

2

3

enter B1 and copy to B2 and B3
formula for B1 =vlookup(Scores!B1,Table!$A$1:$L$3,2,True)
Formula for B2 =vlookup(Scores!B2,Table!$A$1:$L$3,2,True)
Formula for B3 =vlookup(Scores!B3,Table!$A$1:$L$3,2,True)

Copy B1 to C1 thru L1
C1 change 2 to 3, then copy C1 to C2 and C3
Similar to above but "2,false" changes to "3,false"
formula for C1 =vlookup(Scores!C1,Table!$A$1:$L$3,3,True)
Formula for C2 =vlookup(Scores!C2,Table!$A$1:$L$3,3,True)
Formula for C3 =vlookup(Scores!C3,Table!$A$1:$L$3,3,True)

D1 change 2 to 4, then copy D1 to D2 and D3
Similar to above but "3,false" changes to "4,false"
formula for D1 =vlookup(Scores!D1,Table!$A$1:$L$3,4,True)
Formula for D2 =vlookup(Scores!D2,Table!$A$1:$L$3,4,True)
Formula for D3 =vlookup(Scores!D3,Table!$A$1:$L$3,4,True)

continue to column L is simialr fashion

" wrote:

I have 21 columns with headings A, B, C, etc. with values between 0 to
11 in each cell. On a second worksheet, I have a table with
interpretations for High, Medium and Low for each of the column
headings (A, B, C, etc.)

High Medium Low
A A-Hi A-Med A-Low
B B-Hi B-Med B-Low
C C-Hi C-Med C-Low
etc.

I need to replace the values in worksheet one according to their
interpretations e.g. scores between 0 and 3 in the column A should
pull the text for A-Low, scores between 4 and 7 should pull the text
for A-Medium and scores between 8 and 11 should pull the text for A-
High. Similarly for the other columns.

Can anyone tell me the best way to do this? I am an absolute newbie
with no experience of writing macros or VBA.

Thanks,
Divyanshu