Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Syntax Error Help needed

How can I fix this code line below. I am getting a "Run-time error '1004':"
"The formula you typed contains an error."
I tried putting quotes at the end and that didn't solve the problem.

ActiveWorkbook.Names.Add Name:="siteList",
RefersToR1C1:="=Error_MarketList!$A$5:$A$" & errorWS_lastRow
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Syntax Error Help needed

untested, but just an observation;
I would expect the reference following RefersToR1C1 ro be in R1C1 notation,
but this appears to be in A1 notation.
Maybe try RefersTo instead of RefersToR1C1?

HTH,
Keith

"Ayo" wrote:

How can I fix this code line below. I am getting a "Run-time error '1004':"
"The formula you typed contains an error."
I tried putting quotes at the end and that didn't solve the problem.

ActiveWorkbook.Names.Add Name:="siteList",
RefersToR1C1:="=Error_MarketList!$A$5:$A$" & errorWS_lastRow

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Syntax Error Help needed

Hello:

If all you are trying to do is create a range dynamically, you could use
this simple method:

Public Sub Tester()

Dim errorWS_lastRow As Integer
Dim strRange As String

errorWS_lastRow = 20

strRange = "A5:A" & errorWS_lastRow

Range(strRange).Name = "sitelist"

End Sub

--
Rich Locus
Logicwurks, LLC


"Ayo" wrote:

How can I fix this code line below. I am getting a "Run-time error '1004':"
"The formula you typed contains an error."
I tried putting quotes at the end and that didn't solve the problem.

ActiveWorkbook.Names.Add Name:="siteList",
RefersToR1C1:="=Error_MarketList!$A$5:$A$" & errorWS_lastRow

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
AppActivate syntax - help needed Tom Joseph Excel Programming 1 February 28th 09 07:41 AM
VBA code to sum a row: syntax needed [email protected] Excel Discussion (Misc queries) 1 July 11th 05 06:41 PM
Please explain syntax needed Nobody[_3_] Excel Programming 1 June 3rd 04 10:50 PM
Multiple Condition syntax needed Jetheat Excel Programming 3 May 30th 04 11:18 PM
Syntax needed for With count Excel Programming 4 April 6th 04 02:33 PM


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