vba

How can I use input from a TextBox in a PowerQuery Formula?

筅森魡賤 提交于 2021-02-08 10:20:30
问题 I would like to use a PowerQuery Formula which includes input from a text box like Json.Document(Web.Contents("https://thesite.com/api/widgets", [Query=[name=TextBoxName.Text]])) But I get this error Expression.Error: The import TextBoxName.Text matches no exports. Did you miss a module reference? How do I use TextBoxName.Text as a parameter in my query? 回答1: Does it have to be a text box? Put the value in an Excel table instead and call that table "Parameters". Then write a function that

How can I use input from a TextBox in a PowerQuery Formula?

╄→尐↘猪︶ㄣ 提交于 2021-02-08 10:19:22
问题 I would like to use a PowerQuery Formula which includes input from a text box like Json.Document(Web.Contents("https://thesite.com/api/widgets", [Query=[name=TextBoxName.Text]])) But I get this error Expression.Error: The import TextBoxName.Text matches no exports. Did you miss a module reference? How do I use TextBoxName.Text as a parameter in my query? 回答1: Does it have to be a text box? Put the value in an Excel table instead and call that table "Parameters". Then write a function that

How to To Loop through cells in a column, and to find the latest date of the list in Excel VBA

自作多情 提交于 2021-02-08 10:18:49
问题 Actual work to loop through the Column A which has same value of with certain range, with that range have to check the latest date with the comment in Column B and print the comment with date in Column C kindly help me to find the solution for this problem.. Or Guide to find the solution for this problem... Kindly check the Screenshot for clear information.. Thanks in Advance Experts 回答1: Loops are probably the most powerful things is all computer programming topics. Please see the examples

Copy data from rows in different column order

自古美人都是妖i 提交于 2021-02-08 10:18:10
问题 I need to copy rows of data from one worksheet to another. But i have to change the order of the columns. For example Data from A,B,C in columns E,L,J and so on. I already worked on a solution and the code below hopefully shows what i want to do. Is there a cleaner way to copy the data? My version is quite slow while executing. How can i copy the data in the target worksheet without empty rows? Sub KopieZeilenUmkehren() Dim Zeile As Long Dim ZeileMax As Long Dim n As Long With Sheets("Artikel

How to click on the save button when pop-up appears?

僤鯓⒐⒋嵵緔 提交于 2021-02-08 10:17:30
问题 I am using Internet Explorer to click on a file. I get to a point where an Internet Explorer pop-up appears saying "Do you want to open or save the file?": I want to write a VBA code that clicks on the save button. I realized it is not possible to right click and "inspect element" in order to show the HTML page because the pop-up is not part of the internet explorer webpage. So I tried the sendKeys method even though it is not reliable. I tried different options such as : Application.SendKeys

Copy/Paste file path in already open file dialog window (3rd party) with VBA

谁说胖子不能爱 提交于 2021-02-08 10:16:48
问题 My native language isn't English and I am relativly new to VBA, so I apologize in advance. My problem is the following: A part of my VBA code trys to copy and paste a file path from the clipboard that was defined in a string variable before. I do have a solution but that consists of using "Sendkeys" - not quite content with that one even if it works Is there an alternative way to Sendkeys ? Like for example to find and activate the already open file dialog, specifically the input field within

Copy all named ranges to another workbook

蓝咒 提交于 2021-02-08 10:13:00
问题 So I've been fussing with the Microsoft Support answer to this question but their code is simply not working. I'm confused about how they do not define x, or maybe x always equals a variable in VBA? Anyway, I am trying to copy all named ranges in one workbook and bring them over to another workbook. I have to do this for 50-odd workbooks and there are 30-40 named ranges in the base workbook. I really do not want to have to copy-paste these buggers manually. Here's the code they gave for this

How to make the Combobox item list dynamic?

一个人想着一个人 提交于 2021-02-08 10:12:53
问题 I am using a 'Generate' button on my worksheet. When I click on the button, a popup (form) come, which contains two comboboxes. Basis the selection in the first combobox, the second combobox option list is populated. For the first combobox, when I hardcode the item values it works fine. The form code is as follows: Private Sub UserForm_Initialize() With ComboBox_DL .AddItem "DL1" .AddItem "DL2" End With End Sub I tried to make this item list dynamic by fetching the combobox item values from a

Excel VBA: Long Execution Time

不打扰是莪最后的温柔 提交于 2021-02-08 10:12:03
问题 I've created a VBA code to delete extra rows and columns that were needed for initial calculations but are required to be removed before converting/importing a csv into a database. The code loops through 21 sheets and runs for about 4 minutes. Is this a decent run time or can it be shortened? ~Thanks Public Sub Test() Dim xWs As Worksheet Set xWs = ActiveSheet Dim Firstrow As Long Dim Lastrow As Long Dim Lrow As Long Dim CalcMode As Long Dim ViewMode As Long 'SETTING DEPENDENT VALUES TO

How to make the Combobox item list dynamic?

独自空忆成欢 提交于 2021-02-08 10:10:46
问题 I am using a 'Generate' button on my worksheet. When I click on the button, a popup (form) come, which contains two comboboxes. Basis the selection in the first combobox, the second combobox option list is populated. For the first combobox, when I hardcode the item values it works fine. The form code is as follows: Private Sub UserForm_Initialize() With ComboBox_DL .AddItem "DL1" .AddItem "DL2" End With End Sub I tried to make this item list dynamic by fetching the combobox item values from a