Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Frustration - Excel

Status
Not open for further replies.

brianh123

Programmer
Mar 4, 2003
23
US
Hello:

Well I am trying to create an Excel Application, which would copy a selected (via a combo box) defined name to a new worksheet. I am having trouble.

Here is my current code:


code:--------------------------------------------------------------------------------
For r = 1 To nms.count
formation = cboSelectPlay.Text
nms(r).Name = formation
'wks.Cells(r, 2).Value = nms(r).Name
Debug.Print nms(r).Name
Debug.Print nms(r).RefersToRange.Address
Worksheets("Inglemoor LLF Playbook Template").Range(nms(r).RefersToRange.Address).Copy
Set NewSheet = Worksheets.Add
NewSheet.Range("A1").PasteSpecial Paste:=xlPasteAll
'wks.Cells(r, 3).Value = nms(r).RefersToRange.Address
Next
--------------------------------------------------------------------------------
 
Just so I am clear...are you wanting to copy the named range itself and the area it refers to or the contents of the named range ?? Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Hello Brian,

Where is your current code breaking? Is some of it working or is nothing working? If you can give some specific examples of values and how you want it to work that would also be helpful.

Good Luck!
 
I posted twice on this subject on accident - sorry. It does not break, instead it does not copy. It seems to, but when I go to look at the new page it has not copied anything.
 
Yes but what exactly are you trying to do....copy the named range or the contents of the named range ??????? Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top