Channel: MrExcel.com
Category: Howto & Style
Tags: excel tutorialeasier way to format currency in excelmrexcelقائمة العملات في excelcurrency drop-down in excelإضافة عملات إلى شريط إكسلformatting currency in excelbill jelenmicrosoft exceladding currencies to the excel ribbonexcelmr excelexcel makroswitching between currencies in excelالتبديل بين العملات في excel
Description: Today a question from someone who frequently uses three currency styles in Excel: USD, EGP, and SAR. Excel makes it easy to choose USD, GBP, EUR, CHF but if your currency is not in that drop-down, then you are scrolling through an insanely long list. It seems that there is no good way to change the five currencies in the drop-down on the Excel home tab. Instead, I propose a scheme where you can add SAR or EGP from a button on the Quick Access Toolbar and that button will also add the currency to the Cell Styles gallery that travels with the workbook. This means that your co-workers can choose SAR or EGP without having anything in their personal macro workbook. Check out my courses on Retrieve: mrexcel.retrieve.com/store/# Table of Contents (0:00) Difficult to choose most currencies (2:19) The macro (3:42) Adding to Quick Access Toolbar (4:55) Testing in new workbook (5:25) Adding Styles Gallery to QAT (7:34) New Excel learning guides on Retrieve platform Here is the code from the Personal Macro Workbook for SAR: Sub ApplySARStyle() ' Attempt to apply SAR style ' If it does not exist, create it. Err.Clear On Error Resume Next Selection.Style = "SAR" If Err.Number = 0 Then ' The style already exists. Okay to exit On Error GoTo 0 Exit Sub End If ' If you get here, SAR does not exist. ' Format the selection and create a new style ActiveWorkbook.Styles.Add Name:="SAR" With ActiveWorkbook.Styles("SAR") .IncludeNumber = True .IncludeFont = False .IncludeAlignment = False .IncludeBorder = False .IncludePatterns = False .IncludeProtection = False .NumberFormat = "[$SAR] #,##0" End With Selection.Style = "SAR" End Sub