#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default R1C1

Why won't this work?

Sub b9vlookup()
Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Cells(x + 2).FormulaR1C1 = "=VLOOKUP(R[3]C,Address!R[-4]C:R[15]C[3],2)"


End If
Next
End Sub

--
Stacia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default R1C1

Where is the formula supposed to land. In this part you indicate the row
index without a column index...

Cells(x + 2).
prehaps
Cells(x + 2, 1)
--
HTH...

Jim Thomlinson


"stacia" wrote:

Why won't this work?

Sub b9vlookup()
Dim theRange As Range
Dim lastrow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastrow = theRange.Cells(theRange.Cells.Count).Row
firstRow = theRange.Cells(1).Row
For x = lastrow To firstRow Step -1
If InStr(1, Cells(x, 1), "Total") 0 Then
Cells(x + 2).FormulaR1C1 = "=VLOOKUP(R[3]C,Address!R[-4]C:R[15]C[3],2)"


End If
Next
End Sub

--
Stacia

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
R1C1 stacia Excel Discussion (Misc queries) 0 February 16th 10 06:19 PM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Discussion (Misc queries) 3 September 13th 07 08:31 AM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Worksheet Functions 3 September 13th 07 08:31 AM
R1C1 Arne Hegefors Excel Discussion (Misc queries) 1 August 18th 06 10:11 AM
A:1 now R1C1 Michael E W Excel Worksheet Functions 2 December 24th 05 11:38 PM


All times are GMT +1. The time now is 04:52 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"