Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.