Optimizing the VBA Code and improve the performance

不问归期 提交于 2021-02-13 11:24:25
问题 I have developed a VBA macro which is used to refresh the 5 SAP AAO Queries and then copy those queries data into tables saperately by removing duplicates and then loaded into the power query. There i add some calculated columns and then load that data into the power pivots. I have also used the VBA code mentioned below to perform some actions in each of the sheets, however it is currently taking more than 4 minutes to run the code. In that 4 minutes at least 45 seconds are going for

Print specific data with Json perse

随声附和 提交于 2021-02-11 15:20:53
问题 This is json code (https://textsaver.flap.tv/lists/3ic4) and i am trying Sub test() Dim req As New MSXML2.XMLHTTP60 Dim URL As String, ws As Worksheet Dim json As Object, r, r1 As String URL = "https://www.nseindia.com/api/quote-equity?symbol=DIVISLAB" With req .Open "GET", URL, False .send Set json = JsonConverter.ParseJson(.responseText) r = json("data")(1)("CH_OPENING_PRICE") r1 = json("data")(1)("CH_CLOSING_PRICE") End With Debug.Print r Debug.Print r1 End Sub I want to print TEXT

How do i use Dlookup for Multiple Criteria to create a dynamic Combobox

我们两清 提交于 2021-01-29 09:43:07
问题 I have two Comboboxes on a from: txtKategorie and txtTyp. The values for the frist Combobox (txtKategorie) are fix! I want the values of the second Combobox (txtTyp) to change according to what the user chooses in the first one. If the user chooses "Datalogger" the second combobox should only contain "Base Layer Classic" and "Base Layer Plus" as can be seen in the image. The same idea is true for "Accelerometer". I've put my code in the AfterUpdate Event of the first Combobox: If txtKategorie

Why do I need a space before the '^' operator in VBA for Excel 2013 or it will produce a compile time error “Expected list or separator”

我的梦境 提交于 2019-12-02 13:58:52
问题 If I type for example Sqr(a ^ 2 + b ^ 2) there is no error. But when I type Sqr(a ^ 2 + b^ 2) it produces a compile error which I do not understand: What is the function of ^ in VBA7 as opposed to _^ (underscore to show space) which denotes exponentiation? 回答1: This is a 64 bit issue. ^ can confuse the compiler as to whether an operator versus operand value as LongLong is being used. This problem occurs because the circumflex character (^) is ambiguous in this context. For 64-bit versions of