Default to minus figure

Jackewing98

New Member
Joined
Jan 19, 2006
Messages
27
Hello

I am trying to automatically default some cells to a minus figure. I have seen you could do an ABS formula but wondered if there was an easier way? I only want to do some cells in the column as the others are positive figures.

Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
If you want something automated, you could do a VBA approach, but we would need more information, such as:
- Would this run on existing data, or should data automatically updated as it is being entered?
- What range of data would this apply to (certain columns or rows)?
- What is the logic for determining which entries to change and which to leave alone?
 
Upvote 0
Hi

It is for a mortgage comparison calculator I put together. At the moment if there is an incentive such as Cashback you would put this in the "Other Fees" box e.g. -£500, however this means the Adviser has to remember to put a minus sign in. I was hoping to add in another row labelled "Cashback" which when a figure is input it would automatically be treated as a negative.


Book1
BC
3
4Repayment Mortgages
5
6Option One
7Loan Amount (inc any fees added to loan)
8Other Fees (not added to loan)
9Term of Mortgage (in years)
10Initial Interest Rate
11Term of Initial Interest Rate (in months)
12Monthly Mortgage Payment#NUM!
13Amortised Balance at end of Initial Interest Rate Period#N/A
14
15Option Two
16Loan Amount (inc any fees added to loan)
17Other Fees (not added to loan)
18Term of Mortgage (in years)
19Initial Interest Rate
20Term of Initial Interest Rate (in months)
21Monthly Mortgage Payment#NUM!
22Amortised Balance at end of Initial Interest Rate Period#N/A
23
24
25Option One Total Cost Over Intial Rate Period#NUM!
26Option Two Total Cost Over Initial Rate period#NUM!
27Difference#NUM!
Repayment


Thanks
Stephen
 
Upvote 0
OK. Here is code that will automatically change a positive entry made in column C to negative if column B in that row is "Other Fees".
This code must be placed in the Sheet module to work correctly. To do this, go to the sheet you want it to apply on, right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this code in the resulting VB Editor window:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Only run if a single cell is updated
    If Target.Count > 1 Then Exit Sub

'   Look for an amount entered in column C
    If Target.Column = 3 Then
'       Check to see if entry in column B of that row is "Other Fees" and amount > 0
        If (Target.Offset(0, -1) = "Other Fees") And (Target > 0) Then
            Application.EnableEvents = False
            Target = Target * -1
            Application.EnableEvents = True
        End If
    End If
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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