Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells Q
How could I copy cells in a range but reverse its sign?
E.g To Copy Range A2:D2 to A1:D1 The value in A2= 15000 The value I wish then to see in A1 = -15000 Same for B2:D2 etc There maybe <blanks in cells A2:D2 if so I would still want these blank in A1:D1 Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells Q
Are A1:D1 blank? If so, one way:
Copy A2:D2. Select A1:D1. Choose Edit/Paste Special, selecting the Subtract radio button. In article , Seanie wrote: How could I copy cells in a range but reverse its sign? E.g To Copy Range A2:D2 to A1:D1 The value in A2= 15000 The value I wish then to see in A1 = -15000 Same for B2:D2 etc There maybe <blanks in cells A2:D2 if so I would still want these blank in A1:D1 Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells Q
Hi,
Put this in a1 and drag right to d1 =IF(A2<"",-A2,"") Mike "Seanie" wrote: How could I copy cells in a range but reverse its sign? E.g To Copy Range A2:D2 to A1:D1 The value in A2= 15000 The value I wish then to see in A1 = -15000 Same for B2:D2 etc There maybe <blanks in cells A2:D2 if so I would still want these blank in A1:D1 Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells Q
Thanks guys, what I should have included is that I wanted to do this
via code, so from your suggestions, I recorded below Sub CopyPreviousEvents() Application.ScreenUpdating = False Range("C59:AE60").Select Range("C60").Activate Selection.ClearContents Range("C61:AE61").Select Selection.Copy Range("C60").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlSubtract, _ SkipBlanks:=False, Transpose:=False Range("C61:AE61").Select Application.CutCopyMode = False Selection.ClearContents Range("C6").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I copy big ranges of cells without drag or copy/paste? | Excel Discussion (Misc queries) | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
macro needed to copy blocks of cells across to list of cells down | Excel Programming | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
Copy data into cells until changes trigger new copy | Excel Programming |