$ amount does not calculate with a space

FXA

Board Regular
Joined
Jan 28, 2023
Messages
71
Office Version
  1. 365
Platform
  1. Windows
My issue is when I copy and paste from my source, that source has no comma in the dollar amount when the dollar amount hits the thousands and above. Is there a way around this?

Formula:

=C5+AK8+AK9+AK10

C5 = Starting Balance

AK8 =SUM(N10:N1809)

AK9 =SUM(L10:L1809)

AK10 =SUM(M10:M1809)


Thank you in advance.
 

Attachments

  • EXCEL_CFmI00cvDJ.png
    EXCEL_CFmI00cvDJ.png
    59.1 KB · Views: 31

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I meant a formula to embed in the cells previously without making that extra column then doing a copy n paste ect... but will try this VB Script.
Ok, this works! Next question for this VB macro.

How do I integrate the following so the worksheet will activate and run the code when the sheet is selected?
and, is this correct code for that function to run it every time?

Private Sub Worksheet_Activate()
'your code here
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
'your code here
End Sub
 
Upvote 0
Just put the code in in the worksheet module (I've reduced it to just the bits you need [especially removed the FormulaVersion:=xlReplaceFormula2 as it won't run if your user has an older version of Excel])

VBA Code:
Private Sub Worksheet_Activate()
Columns("N:N").Replace What:=" ", Replacement:="", LookAt:=xlPart
End Sub
 
Upvote 0
Just put the code in in the worksheet module (I've reduced it to just the bits you need [especially removed the FormulaVersion:=xlReplaceFormula2 as it won't run if your user has an older version of Excel])

VBA Code:
Private Sub Worksheet_Activate()
Columns("N:N").Replace What:=" ", Replacement:="", LookAt:=xlPart
End Sub
Like this? Just making sure I wasn't suppose to keep anything you sent me earlier?
 

Attachments

  • EXCEL_Sw1Y0ud9NP.png
    EXCEL_Sw1Y0ud9NP.png
    15.6 KB · Views: 6
Upvote 0
Right click the sheet tab, click view code and paste the code in the window that appears
 
Upvote 0
I went to Developer > Visual Basic then tried adding there.
You could also do it there but you would need to double click your sheets name (the name inside the brackets is the one that shows on your sheet tab), or right click it and click view code
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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