Consulting

Results 1 to 3 of 3

Thread: Solved: copying multiple named ranges to a new table

  1. #1

    Solved: copying multiple named ranges to a new table

    Hi all, i've got a bit of an issue going on with copying data from multiple named ranges across to a 'roll-up' style / plain table style worksheet.

    Here's what i'm doing - to collect entered data, I've created a worksheet in a 'data entry form' style format for my users... (each of the 'data entry' fields, btw is a unique named range) I need to copy across the data from each of the named ranges to a 2nd sheet in my workbook, and present it in a simple table / plain text table...

    Sample sheet attached...

    can anyone point me in the direction of a KB answer for this, or give me an idea of how to do this??



    TIA

    Russ

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I didn't use your named ranges....here's one way:
    [vba]Sub FillRollup()
    With Sheets("Rollup").Columns(1).Rows(65536).End(xlUp)
    .Offset(1, 0) = Sheet1.[C9]
    .Offset(1, 1) = Sheet1.[I9]
    .Offset(1, 2) = Sheet1.[C12]
    .Offset(1, 3) = Sheet1.[I12]
    .Offset(1, 4) = Sheet1.[C15]
    .Offset(1, 5) = Sheet1.[I15]
    .Offset(1, 6) = Sheet1.[D19]
    .Offset(1, 7) = Sheet1.[E19]
    .Offset(1, 8) = Sheet1.[F19]
    .Offset(1, 9) = Sheet1.[J19]
    .Offset(1, 10) = Sheet1.[K19]
    .Offset(1, 11) = Sheet1.[L19]
    .Offset(1, 12) = Sheet1.[C23]
    End With
    End Sub[/vba]
    But you have complicated the clearcontents process with your merged cells.....

    [vba]
    With Sheet1
    [C9].ClearContents
    End With

    [/vba]
    will fail because of the merged cells......
    exampe attached
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    many thanks, i'll give it a go..


Posting Permissions

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