Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Indirect in VBA code
Hi,
I have cell locations saved in a table. When I VLookup the correct location, I need to place the value of that cell location in a cell but I need to do it via VBA code. I have tried: Dim SharePercentLoc as String Dim NewPercentage as long For iCtr = 49 To 349 If Me.Range("J" & iCtr).Value = "Yes" Then SharePercentLoc = Application.VLookup(LineItemspg.Range("C" & _ iCtr - 34).Value, Tablespg.Range("CAMPercentLoc"), 3, False) NewPercentage = Me.Range("""" & SharePercentLoc & """").Value With Me.Range("K" & iCtr) If .Value < NewPercentage Then .Value = NewPercentage End If End With end if next How would I go about this? -- Thanks for your help. Karen53 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Indirect in VBA code
Hi,
Never mind. I found it. Thanks! -- Thanks for your help. Karen53 "Karen53" wrote: Hi, I have cell locations saved in a table. When I VLookup the correct location, I need to place the value of that cell location in a cell but I need to do it via VBA code. I have tried: Dim SharePercentLoc as String Dim NewPercentage as long For iCtr = 49 To 349 If Me.Range("J" & iCtr).Value = "Yes" Then SharePercentLoc = Application.VLookup(LineItemspg.Range("C" & _ iCtr - 34).Value, Tablespg.Range("CAMPercentLoc"), 3, False) NewPercentage = Me.Range("""" & SharePercentLoc & """").Value With Me.Range("K" & iCtr) If .Value < NewPercentage Then .Value = NewPercentage End If End With end if next How would I go about this? -- Thanks for your help. Karen53 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions | Excel Worksheet Functions | |||
INDEX("a"&COLUMNS(INDIRECT(A1):INDIRECT(A2)):A30,4) | Excel Discussion (Misc queries) | |||
Indirect? | Excel Worksheet Functions | |||
Indirect equivalent in VBA code | Excel Programming | |||
"Indirect" reference to a cell in a code: how to do it? | Excel Programming |