Jumat, 21 Juni 2013

Re: [ExcelVBA] Naming a Range from a variable

 

I tried it and it worked with no problem.
Unless the value in the Job_No range is NUMERIC.
 
The value in the job_No range must follow the rules for Range Names.
 
Otherwise, it worked fine for me!

Paul
-----------------------------------------
"Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can." - John Wesley
-----------------------------------------

>________________________________
>From: Hafizullah <hafizullah@aol.com>
>To: ExcelVBA@yahoogroups.com
>Sent: Friday, June 21, 2013 2:33 AM
>Subject: [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]
>
>
>

[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 (2)
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