- Total Members: 220,002
- Threads: 525,379
- Posts: 976,969
-
November 7th, 2012, 03:32 PM
#1
VBA Tab referencing - tricky
So I've researched online for hours, and gone through some of my reference books. I can't seem to find an answer to this specific issue with referencing the worksheet objects.
I'm trying to create a name in my macro that is 1/2 fixed and 1/2 variable, with the variable being based on a cell value. It seems possible, I'm sure there is just a simple error in my syntax that I can't figure out. Here is what I'm trying to do:
Range C4 = dropdown list with first names
Tabs = There is a tab with just the name, (i.e. "Bob"), and another tab that is the name and "-Goals". So Bob would have two tabs, "Bob" and "Bob-Goals". The tabs and their names are created and fixed. So I am trying to do a simple copy and paste of the Range C9:C19, but I want the values to paste into the "-Goals" sheet for whichever name is in C4, instead of creating a separate IF statement for every single tab. Here is what I have now that isn't working currently....
Dim RMName As String
RMName = Range("C4")
Range("C9").Select
Selection.Copy
Worksheets(RMName - Goals).Range ("C5")
I have tried every combination I can think of for the last line above, using "" and the & connectors. As it shows above, the bug message I get is "Type mismatch". Any help?
Similar Threads
-
By dtayl20 in forum Microsoft Access Help
Replies: 2
Last Post: July 11th, 2007, 04:14 PM
-
By Abbu in forum Visual Basic Programming
Replies: 3
Last Post: August 12th, 2004, 03:46 PM
-
By agentcid in forum Visual Basic Programming
Replies: 3
Last Post: July 28th, 2004, 07:21 AM
-
By xxLewisxx in forum ASP Development
Replies: 14
Last Post: April 6th, 2004, 09:39 AM
-
By matches in forum .NET Development
Replies: 1
Last Post: April 5th, 2004, 02:37 PM