Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting range to work in my code

nathan2314nathan2314 Posts: 3Member
Hey all,
how come this won't work? I'm trying to create a range and then set another range of cells equal to the created range values.
Here is my code
[code] If Sheets("Long Term Input Data").Range("AB1") = "E6" Then
Set training_range_179 = Sheets("179 Training Requirements").Range("C92:Z92")
Set training_range_365 = Sheets("365 Training Requirements").Range("C92:Z92")
End If
training_range_179.name = "training_range_179"
training_range_365.name = "training_range_365"

Worksheets("179 Training Requirements").range("C4:Z4") = Range("training_range_179")
[/code]

I thought I had done this same thing in some of my earlier vba coding but it doesn't work. So I must be missing something..
Help!!


Comments

  • rushenttrushentt Posts: 33Member
    Have you tried using the value property, eg:
    Sheets("Long Term Input Data").Range("AB1").Value = "E6"
    and see if that works?

    Rgds

    Terry

    : Hey all,
    : how come this won't work? I'm trying to create a range and then set
    : another range of cells equal to the created range values.
    : Here is my code
    : [code]: If Sheets("Long Term Input Data").Range("AB1") = "E6" Then
    : Set training_range_179 = Sheets("179 Training Requirements").Range("C92:Z92")
    : Set training_range_365 = Sheets("365 Training Requirements").Range("C92:Z92")
    : End If
    : training_range_179.name = "training_range_179"
    : training_range_365.name = "training_range_365"
    :
    : Worksheets("179 Training Requirements").range("C4:Z4") = Range("training_range_179")
    : [/code]:
    :
    : I thought I had done this same thing in some of my earlier vba
    : coding but it doesn't work. So I must be missing something..
    : Help!!
    :
    :
    :
Sign In or Register to comment.