excelNewbie22
Well-known Member
- Joined
- Aug 4, 2021
- Messages
- 528
- Office Version
- 365
- Platform
- Windows
hi,
i tried recording a macro for copying a range of cells,
then goes to the bottom of the table,
to the next empty line
and paste only values,
and it worked well,
but when i trying running it again,
it overwrites the last paste, why?
code:
and also,
can anyone help me out with a macro that change a range in a cell?
like if a9 is:
=a20:g50
i want the macro to change it to:
a19:g50
and so on, subtract 1 every macro run (a18 then a17....)
?
i tried recording a macro for copying a range of cells,
then goes to the bottom of the table,
to the next empty line
and paste only values,
and it worked well,
but when i trying running it again,
it overwrites the last paste, why?
code:
VBA Code:
Sub copy2()
'
' copy2 macro
'
'
Range("L2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.copy
Selection.End(xlToLeft).Select
Range("L2").Select
Selection.End(xlDown).Select
Range("L7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L8").Select
End Sub
and also,
can anyone help me out with a macro that change a range in a cell?
like if a9 is:
=a20:g50
i want the macro to change it to:
a19:g50
and so on, subtract 1 every macro run (a18 then a17....)
?