+ Reply to Thread
Results 1 to 2 of 2

Setting Cells Equal to Subset of Named Range in VBA

Hybrid View

shoulddt Setting Cells Equal to Subset... 03-02-2018, 12:53 AM
Andy Pope Re: Setting Cells Equal to... 03-02-2018, 04:41 AM
  1. #1
    Registered User
    Join Date
    03-16-2016
    Location
    indiana, US
    MS-Off Ver
    2016
    Posts
    33

    Setting Cells Equal to Subset of Named Range in VBA

    Hello all,
    I have a named range that is 800+ rows by 3 columns. There are certain parts of the named range that contain data I need to extract. In the example code below I want to make the "ChassisLF" named range equal to the information from (3,1) to (15,3) in the "Import_Column" named range. How do I properly select the subset?

    Private Sub ImportUserFormButton_Click()
    Dim wsCM As Worksheet, wsI As Worksheet
    
    Set wsCM = Worksheets("Chassis Measure")
    Set wsI = Worksheets("Import")
    
    wsCM.Range("ChassisLF").Value = wsI.Range("Import_Column").Range(.Cells(3, 1), .Cells(15, 3)).Value
    
    End Sub

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Setting Cells Equal to Subset of Named Range in VBA

    try

    with wsI.Range("Import_Column")
        wsCM.Range("ChassisLF").Value = .Range(.Cells(3, 1), .Cells(15, 3)).Value
    End with
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Setting 1 Range equal to Another
    By RoderickBateman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2016, 06:42 PM
  2. Setting The Range In One Worksheet Equal To Another Worksheets Range
    By alacey425 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2015, 06:01 AM
  3. Replies: 2
    Last Post: 09-25-2013, 09:53 AM
  4. Replies: 1
    Last Post: 02-27-2013, 12:00 AM
  5. Setting a dynamic Named range
    By hond in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2012, 09:57 AM
  6. Named range - subset
    By jlt199 in forum Excel General
    Replies: 7
    Last Post: 08-17-2010, 08:48 AM
  7. Setting a 2-dim range equal to several 1-dim ranges
    By soce in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2010, 12:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1