Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to insert pics based on values that appear in a cell. I
have this code and I've got it to work by hardcoding values. Since I have like 500 variables, I'd like to steer clear of hardcoding. What I need help with is selecting the Column to look in and then finding the correct value I know this code doesn't work but it should provide direction to what I'd like to happen. Dim CellLoop As Range Dim CellVal As String CellLoop = Range("G:G") CellVal = ActiveCell.FormulaR1C1 'Don't Know how to get this to work Select Case CellVal in CellLoop Case 1 InsertPicture "C:\Users\mbramer\Desktop\R_RImages\1.jpg", _ ActiveCell.Offset(0, -2), True, True Case 2 InsertPicture "C:\Users\mbramer\Desktop\R_RImages\2.jpg", _ ActiveCell.Offset(0, -2), True, True Case Else MsgBox ("Wrong Values") End Select Thanks for your help! Regards, Matt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compare Sheets values by .find loop? | Excel Programming | |||
select date range then find average of values in another cell | Excel Worksheet Functions | |||
How do I use For loop to pick different Range of cells to Select & Merge? | Excel Programming | |||
loop through cells in a range and pick up corresponding cell values in another range | Excel Programming | |||
Specifying Range.Select in a loop | Excel Programming |