Consulting

Results 1 to 3 of 3

Thread: Solved: Copy Paste non-adjacent cells in a range

  1. #1

    Solved: Copy Paste non-adjacent cells in a range

    Hi,
    I am looking for a way to copy&paste special a range of cell, which is not adjacent.

    The Sub below does exactly, what I want to achieve, but works extremely slow. Is there a way to speed that up?

    Cheers,
    erichq



    [vba]
    Sub Fix_Bloomberg(Blatt_name)

    Application.ScreenUpdating = False


    Dim Zelle As Range
    Dim FoundRange As Range

    Blatt_name.Select
    Set FoundRange = Find_Range("bd", Range("A1:CZ1000"))

    If Not FoundRange Is Nothing Then
    For Each Zelle In FoundRange
    Zelle.Copy
    Zelle.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
    Next Zelle

    End If



    Application.ScreenUpdating = True
    End Sub

    [/vba]

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,874
    It may depend on how fast Find_RTange is.
    I've made some assumptions in the code below, so see if it works as you want:[vba]Sub Fix_Bloomberg(Blatt_name)
    Dim myArea As Range
    Dim FoundRange As Range
    Application.ScreenUpdating = False

    Set FoundRange = Find_Range("bd", Blatt_name.Range("A1:CZ1000"))

    If Not FoundRange Is Nothing Then
    For Each myArea In FoundRange.Areas
    myArea.Value = myArea.Value
    Next myArea
    End If
    Application.ScreenUpdating = True
    End Sub
    [/vba]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3

    solved

    thanks a lot. now it works at the speed of light.cheers

Posting Permissions

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