Consulting

Results 1 to 5 of 5

Thread: excel vba range property non contiguous ranges

  1. #1

    excel vba range property non contiguous ranges

    Hi everybody,


    I just want to fill different non contiguous ranges from an original cell containing
    Sum(E1:E4)
    . Here's the code (wich doesn't work, just to get the idea clearer):


    Selection.AutoFill Destination:=Range("K1:K4", "O1:O5", "Q1:Q5"), Type:=xlFillDefault

    i don't know the correct synthax.
    Thanks for your help

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why are you using autofll rather than just copy? Should the 2nd and 3rd range be 4 cells, not 5?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    i want to do just like in the image. i don't know how exactly to do it, i was trying by using autofill but perhaps there is a better solution

    Attachment 15554
    Attached Images Attached Images

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Like this

        Range("F8").Copy Range("F9, F12:F13, F15:F16, F18, F20")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    It works perfectly well. Thank you xld for your help, that's what i was looking for.

Posting Permissions

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