Kamis, 20 Juni 2013

[ExcelVBA] Naming a Range from a variable

 

Using VBA, I want to assign a name to a range, using a variable set from
the contents of one of the cells in the range. Right now, the variable
is a string.

strJobNbr = Worksheets("Data").Range("JOB_NO").Text
When I go to give my range a name from this variable
Range("C4:R9").Name = strJobNbrit raises
Run-time Error "1004" Application-defined or object-defined error
When I use an arbitrary name embedded in quotes, it executes without a
problem.
What's going on here?
~Hafizullah

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar