excel

Wait until Excel finishes populating Bloomberg data using VBA

风格不统一 提交于 2021-02-07 20:29:15
问题 I have an Excel sheet with ~300,000 BDH formulas to download securities prices. I want to open the file and get all prices paste them as values save and close the file. However, I do not know when Excel finishes populating Bloomberg data, so it's difficult to determine the time to do 2) and 3). I have written VBA, but not sure if it works: In Module1 Sub CheckFormulas() If Application.CalculationState = xlDone Then With Worksheets("Sheet1").UsedRange .Value = .Value End With Else Application

How to create a custom number format in Excel to show comma as decimal separator

末鹿安然 提交于 2021-02-07 20:23:34
问题 E.g. instead of 4,100.3 (American) it would be 4 100,3 回答1: Go to Tools - Options - International Tab (or Advanced if using Office 2010) - Separators (uncheck "use system separators" - and put in what you want as separators. 来源: https://stackoverflow.com/questions/6904063/how-to-create-a-custom-number-format-in-excel-to-show-comma-as-decimal-separator

Square root function in VBA, Excel

穿精又带淫゛_ 提交于 2021-02-07 20:23:08
问题 What is the square root function in VBA excel? I tried SQRT() and Root() but none of them are working, my Excel version in 2013. 回答1: Use the oddly named VBA.Sqr(n) where n is your number for which you want the square root computed. The VBA. prefix is optional, but it helps descriminate between VBA and any other library you might have referenced. 回答2: Nth root can be obtained with VBA with: Option Explicit Function NthRoot(dblNumber As Double, lngRoot As Long) As Double NthRoot = dblNumber ^

Square root function in VBA, Excel

杀马特。学长 韩版系。学妹 提交于 2021-02-07 20:20:44
问题 What is the square root function in VBA excel? I tried SQRT() and Root() but none of them are working, my Excel version in 2013. 回答1: Use the oddly named VBA.Sqr(n) where n is your number for which you want the square root computed. The VBA. prefix is optional, but it helps descriminate between VBA and any other library you might have referenced. 回答2: Nth root can be obtained with VBA with: Option Explicit Function NthRoot(dblNumber As Double, lngRoot As Long) As Double NthRoot = dblNumber ^

VBA Round function vs Worksheet Round function

江枫思渺然 提交于 2021-02-07 19:56:25
问题 I tried to change this Excel function into VBA code Excel =ROUND(value,sigfig-(1+INT(LOG10(ABS(value))))) VBA Public Function sigfig(val As Double, sigf As Integer) As Double Dim var As Double var = Abs(val) var = Application.WorksheetFunction.Log10(var) var = Int(var) sigf = sigf - (1 + var) sigfig = Round(val, sigf) End Function For below 0, both of the Excel and VBA work well. However in VBA, when value (val) is more than sigfig (sigf), it gives me an error. For example, if I want to have

VBA Round function vs Worksheet Round function

。_饼干妹妹 提交于 2021-02-07 19:55:23
问题 I tried to change this Excel function into VBA code Excel =ROUND(value,sigfig-(1+INT(LOG10(ABS(value))))) VBA Public Function sigfig(val As Double, sigf As Integer) As Double Dim var As Double var = Abs(val) var = Application.WorksheetFunction.Log10(var) var = Int(var) sigf = sigf - (1 + var) sigfig = Round(val, sigf) End Function For below 0, both of the Excel and VBA work well. However in VBA, when value (val) is more than sigfig (sigf), it gives me an error. For example, if I want to have

How to enable Unicode in Excel 2016 VBA editor

家住魔仙堡 提交于 2021-02-07 19:51:00
问题 I have a worksheet with Hebrew word "שלום" in cell A1. I am trying to run this VBA code: Sub test() Dim str As String str = Range("A1") MsgBox str End Sub The message box displays: ???? Also, when I try to write Hebrew characters in VBA code: if range("A1") = "שלום" then 'do something...' instead of Hebrew letters I see gibberish. I use Excel 2016 on Windows 10. Hebrew language pack is installed. I did not face this problem in Excel 2010 on Windows 7. Anyone with an idea for enabling Hebrew

“Flatten” multiple rows containing different data but with a common reference into a single row

大憨熊 提交于 2021-02-07 17:30:24
问题 I've tried searching Stackoverflow and Google for an answer to this but haven't found it yet. I think part of my problem is I'm not sure what the keyword(s) for what I'm trying to do would be. My data looks something like this: ID Var1 Var2 Name 01 0001 0002 Bill 01 0001 0002 Jim 01 0001 0002 Sally 02 0003 0004 Sam 02 0003 0004 Kyle You'll see that I have multiple rows with the same ID and same Var1 and Var2 but each row has a unique name. I want to "flatten" the rows so there is only a

“Flatten” multiple rows containing different data but with a common reference into a single row

风流意气都作罢 提交于 2021-02-07 17:30:07
问题 I've tried searching Stackoverflow and Google for an answer to this but haven't found it yet. I think part of my problem is I'm not sure what the keyword(s) for what I'm trying to do would be. My data looks something like this: ID Var1 Var2 Name 01 0001 0002 Bill 01 0001 0002 Jim 01 0001 0002 Sally 02 0003 0004 Sam 02 0003 0004 Kyle You'll see that I have multiple rows with the same ID and same Var1 and Var2 but each row has a unique name. I want to "flatten" the rows so there is only a

“Flatten” multiple rows containing different data but with a common reference into a single row

爷,独闯天下 提交于 2021-02-07 17:28:16
问题 I've tried searching Stackoverflow and Google for an answer to this but haven't found it yet. I think part of my problem is I'm not sure what the keyword(s) for what I'm trying to do would be. My data looks something like this: ID Var1 Var2 Name 01 0001 0002 Bill 01 0001 0002 Jim 01 0001 0002 Sally 02 0003 0004 Sam 02 0003 0004 Kyle You'll see that I have multiple rows with the same ID and same Var1 and Var2 but each row has a unique name. I want to "flatten" the rows so there is only a