Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default 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
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
Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions Mike Barlow Excel Worksheet Functions 7 May 21st 23 07:42 PM
INDEX("a"&COLUMNS(INDIRECT(A1):INDIRECT(A2)):A30,4) Dave F[_2_] Excel Discussion (Misc queries) 3 September 20th 07 08:36 PM
Indirect? Robert[_4_] Excel Worksheet Functions 2 August 16th 07 12:43 PM
Indirect equivalent in VBA code Ken Rock Excel Programming 2 September 24th 05 02:25 PM
"Indirect" reference to a cell in a code: how to do it? bondcrash[_11_] Excel Programming 1 September 16th 05 04:48 PM


All times are GMT +1. The time now is 10:23 AM.

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"