Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
macro needed to copy blocks of cells across to list of cells down piersonpro Excel Programming 3 March 28th 07 12:51 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"