ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Copy/Paste Help (https://www.excelbanter.com/excel-programming/278952-macro-copy-paste-help.html)

esi

Macro Copy/Paste Help
 
Trying to design a macro that will take a multiple column range say B1:C25
and copy all cells with values, move them up 1 cell and then paste value. I
found was doing this manually and the whole process take forever when
you're dealing with multiple cells and worksheets.

Thanks



Bernie Deitrick[_2_]

Macro Copy/Paste Help
 
esi,

We need more information.

What do you do with a value in Cell B1? Where do you move it to?

Do you only move values to currently blank cells? Is the whole range
shifted, or just some cells?

Post back...
Bernie


"esi" wrote in message
...
Trying to design a macro that will take a multiple column range say

B1:C25
and copy all cells with values, move them up 1 cell and then paste

value. I
found was doing this manually and the whole process take forever

when
you're dealing with multiple cells and worksheets.

Thanks





Chrissy[_4_]

Macro Copy/Paste Help
 
Sub MoveUp()
Dim RangeToMove As Range
Dim x, y, z as Integer

Set RangeToMove = Selection

If RangeToMove.Areas.Count = 1 Then

RangeToMove.Copy
RangeToMove.Offset(-1, 0).PasteSpecial Paste:=xlValues

x = RangeToMove.Rows.Count - 1
y = RangeToMove.Columns.Count - 1

For z = 0 To y
RangeToMove.Offset(x, z).Range("A1").ClearContents
Next z

End If
RangeToMove.Select
End Sub



esi wrote
Trying to design a macro that will take a multiple column range say B1:C25
and copy all cells with values, move them up 1 cell and then paste value. I
found was doing this manually and the whole process take forever when
you're dealing with multiple cells and worksheets.

Thanks






All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com