how do i set up a column with negative values automatically?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am having to enter negative numbers in a single column. is there a way to
do so without having to enter all of them one by one manually? is there a
command that will automatically make my entry negative?
 
Lets say you enter all the numbers in your column as positive (without the -
sign). Then enter -1 in an unused cell somewhere. Copy this cell and paste
it special into all your positive numbers with the multiply option checked.

This will make all your numbers negative in one fell swoop.
 
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Column = 2 Then
.Value = Abs(.Value)
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
One way
In a blank cell enter -1 copy highlight range with numbers needing
correction Edit>paste special and click the radio button for multiply
HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top