Copy paste with Absolute Values, Can it be done?

CVBASIMON

New Member
Joined
May 30, 2012
Messages
30
I have copied over a row of $, ($) amounts from one worksheet to another. I am trying to make the amounts I copy over past in absolute values. Is there a way to do this? Below is the current code:

'copying over the Amount in Local Currency ST Reclass
Sheets("Recon_ST").Select
Range("S9").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
Sheets("ST Journal entries").Select
Range("J2").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try something like this...

Code:
    [color=green]'copying over the Amount in Local Currency ST Reclass[/color]
    [color=darkblue]Dim[/color] c [color=darkblue]As[/color] [color=darkblue]Variant[/color], i [color=darkblue]As[/color] [color=darkblue]Long[/color]
    
    [color=darkblue]With[/color] Sheets("Recon_ST")
        c = .Range("S9", .Range("S9").End(xlDown))
    End [color=darkblue]With[/color]
    
    [color=darkblue]For[/color] i = 1 [color=darkblue]To[/color] [color=darkblue]UBound[/color](c)
        c(i, 1) = Abs(c(i, 1))
    [color=darkblue]Next[/color] i
    
    Sheets("ST Journal entries").Range("J2").Resize(UBound(c)).Value = c
 
Upvote 0
Try something like this...

Code:
    [COLOR=green]'copying over the Amount in Local Currency ST Reclass[/COLOR]
    [COLOR=darkblue]Dim[/COLOR] c [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Variant[/COLOR], i [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Long[/COLOR]
 
    [COLOR=darkblue]With[/COLOR] Sheets("Recon_ST")
        c = .Range("S9", .Range("S9").End(xlDown))
    End [COLOR=darkblue]With[/COLOR]
 
    [COLOR=darkblue]For[/COLOR] i = 1 [COLOR=darkblue]To[/COLOR] [COLOR=darkblue]UBound[/COLOR](c)
        c(i, 1) = Abs(c(i, 1))
    [COLOR=darkblue]Next[/COLOR] i
 
    Sheets("ST Journal entries").Range("J2").Resize(UBound(c)).Value = c


Thank you Alpha Frog! Worked perfectly. :biggrin:
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,109
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top