Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
pgi pgi is offline
external usenet poster
 
Posts: 1
Default Excel VBA - use of ActiveCell.FormulaR1C1

I am writing a macro of which one of the statement have the following
formula

ActiveCell.FormulaR1C1 = "=IF(BK2=""PC
Number"",VLOOKUP(BN2,'O:\Documentation\Asset
Management\Hardware\[Assets -
Latest.xls]Sheet1'!$F$2:$CE$350,74,FALSE),IF(BK2=""Login
ID"",VLOOKUP(BN2,'O:\Documentation\Asset Management\User\[All
Users.xls]Sheet1'!$F$2:$Z$550,21,FALSE),""**CHECK""))"

The above was recorded using macro record and was working find. But
when trying to rerun the macro if produced an error on the syntax.

It seems the confusion here is the number of quotes ". Please advise
how best to resolve the assignment problem.


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel VBA - use of ActiveCell.FormulaR1C1

This works for me

Dim sPath As String
sPath = "O:\Documentation\Asset Management\Hardware\"
ActiveCell.Formula = "=IF(BK2=""PC Number"",VLOOKUP(BN2,'" & _
sPath & "Hardware\" & _
"[Assets -
Latest.xls]Sheet1'!$F$2:$CE$350,74,FALSE)," & _
"IF(BK2=""Login ID"",VLOOKUP(BN2,'" & _
sPath & "User\[" & _
"All
Users.xls]Sheet1'!$F$2:$Z$550,21,FALSE),""**CHECK""))"

Note Formula, not FormulaR1C1.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pgi " wrote in message
...
I am writing a macro of which one of the statement have the following
formula

ActiveCell.FormulaR1C1 = "=IF(BK2=""PC
Number"",VLOOKUP(BN2,'O:\Documentation\Asset
Management\Hardware\[Assets -
Latest.xls]Sheet1'!$F$2:$CE$350,74,FALSE),IF(BK2=""Login
ID"",VLOOKUP(BN2,'O:\Documentation\Asset Management\User\[All
Users.xls]Sheet1'!$F$2:$Z$550,21,FALSE),""**CHECK""))"

The above was recorded using macro record and was working find. But
when trying to rerun the macro if produced an error on the syntax.

It seems the confusion here is the number of quotes ". Please advise
how best to resolve the assignment problem.


---
Message posted from http://www.ExcelForum.com/



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
ActiveCell.FormulaR1C1 Rick Excel Discussion (Misc queries) 3 March 28th 10 10:36 PM
activecell.formular1c1 monika Excel Programming 0 April 29th 04 10:13 AM
Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row) Ashish Shridharan Excel Programming 2 February 15th 04 04:46 PM
Whats wrong with this VBA statement -ActiveCell.FormulaR1C1...? hal Excel Programming 5 November 8th 03 02:48 AM
ActiveCell.FormulaR1C1 Leif Rasmussen Excel Programming 1 October 16th 03 09:46 AM


All times are GMT +1. The time now is 11:19 PM.

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"