ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Code to Populate Cell Range (https://www.excelbanter.com/excel-programming/295056-need-code-populate-cell-range.html)

Kevin Beckham

Need Code to Populate Cell Range
 
In cell Sheet1 range M11 put
=OFFSET(Sheet2!E10,MATCH(Sheet2!C11,
{"T1","T2","R1","R2","R3","R4"},0),0)

or substitute the array with the range used to populate
the ComboBox

Kevin Beckham

-----Original Message-----
A workbook has two sheets: Sheet1 and Sheet2

In Sheet1 I want to populate merged cell range M11:AK12

as follows:

If Sheet2, cell C11 = "T1", insert Sheet2!E11 data in

Sheet1 range M11
If Sheet2, cell C11 = "T2", insert Sheet2!E12 data in

Sheet1 range M11
If Sheet2, cell C11 = "R1", insert Sheet2!E13 data in

Sheet1 range M11
If Sheet2, cell C11 = "R2", insert Sheet2!E14 data in

Sheet1 range M11
If Sheet2, cell C11 = "R3", insert Sheet2!E15 data in

Sheet1 range M11
If Sheet2, cell C11 = "R4", insert Sheet2!E16 data in

Sheet1 range M11

As background, Sheet2!C11 is populated by a ComboBox

LinkedCell

What is the code to make this happen?

.



All times are GMT +1. The time now is 03:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com