EirikDaude
05-08-2014, 12:30 AM
I was originally trying to do something like this:
Set kopierFra = Range(ws.Range("B1048576").End(xlUp).Offset(0, -1), ws.Range("B1048576").End(xlUp).Offset(0, 5))
kopierFra.Copy
For i = 1 To CLng(ufKopierRad.tbxAntalKopiar)
Set kopierTil = kopierFra.Offset(0, i)
kopierTil.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
kopierTil.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
kopierTil.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Next
But it seems the range I want to copy is removed from the clipboard for every paste-operation I do? Is there any way to avoid this, or will I simply have to put a copy-statement before every paste? Or is there alternately some way to paste all of the properties I want from the source-range to the destination without needing three paste-statements, or even a for-loop?
Set kopierFra = Range(ws.Range("B1048576").End(xlUp).Offset(0, -1), ws.Range("B1048576").End(xlUp).Offset(0, 5))
kopierFra.Copy
For i = 1 To CLng(ufKopierRad.tbxAntalKopiar)
Set kopierTil = kopierFra.Offset(0, i)
kopierTil.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
kopierTil.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
kopierTil.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Next
But it seems the range I want to copy is removed from the clipboard for every paste-operation I do? Is there any way to avoid this, or will I simply have to put a copy-statement before every paste? Or is there alternately some way to paste all of the properties I want from the source-range to the destination without needing three paste-statements, or even a for-loop?