excel

VBA Variable as CommandButton#

强颜欢笑 提交于 2021-02-17 02:48:51
问题 I'm rewriting some code and had a thought, but can't seem to get my syntax right to execute it properly. I want to use a for loop to populate an array of commandbuttons as well as control their visibility. I just need help with my syntax to define which CommandButton number I'm working on in the loop. For instance, CommandButton1, CommandButton2, etc. Public Sub LoadLots(sName As String, streamLots() As String) Label1.Caption = sName For o = 1 To 9 If streamLots(o) <> "" Then CommandButton& o

Edit a workbook, whether open or closed, from Word VBA

安稳与你 提交于 2021-02-17 02:48:36
问题 I am trying to write a macro in Word so that I can save some information into an Excel file somewhere else in my computer. For this reason I wrote this: Dim exlApp As Object Dim exlWbk As Object Set exlApp = CreateObject("Excel.Application") Set exlWbk = exlApp.Workbooks.Open(FileName:="D:\database.xlsx") exlWbk.ActiveSheet.Cells(1, 1).Value = "some info" exlWbk.Close SaveChanges:=True Set exlWbk = Nothing exlApp.Quit Set exlApp = Nothing The code works perfectly fine for me, except when the

Edit a workbook, whether open or closed, from Word VBA

北战南征 提交于 2021-02-17 02:47:26
问题 I am trying to write a macro in Word so that I can save some information into an Excel file somewhere else in my computer. For this reason I wrote this: Dim exlApp As Object Dim exlWbk As Object Set exlApp = CreateObject("Excel.Application") Set exlWbk = exlApp.Workbooks.Open(FileName:="D:\database.xlsx") exlWbk.ActiveSheet.Cells(1, 1).Value = "some info" exlWbk.Close SaveChanges:=True Set exlWbk = Nothing exlApp.Quit Set exlApp = Nothing The code works perfectly fine for me, except when the

Power BI Report with Bridge Table

≡放荡痞女 提交于 2021-02-17 02:42:30
问题 I am trying to use Power BI with my SQL DB. We have a three layer structure A Main table, with information about the year and unique key for each firm A bridge table which an information about the type of the firm Many end Tables with information about sales and stuff On some occasions these end tables are jointly used by different firm types and some only by one firm type. When I load the tables into Power BI all the relationships are correctly imported and I was expecting no issue to create

How to add data to existing XLSX file in MATLAB every time using a push button?

你说的曾经没有我的故事 提交于 2021-02-17 02:38:40
问题 I have a function which generates some variable, like score, right, wrong, unanswered. This function is called using a push button. The problem is how can I add/append these values generated by a function to an XLSX file every time? Or, how to create a MAT file so that it can be added? What may be a possible solution? 回答1: The challenge involved in appending to a xls file is knowing its last row, to avoid overwriting data with the xlswrite command. I'd suggest taking a look at this file

How to add data to existing XLSX file in MATLAB every time using a push button?

假装没事ソ 提交于 2021-02-17 02:37:04
问题 I have a function which generates some variable, like score, right, wrong, unanswered. This function is called using a push button. The problem is how can I add/append these values generated by a function to an XLSX file every time? Or, how to create a MAT file so that it can be added? What may be a possible solution? 回答1: The challenge involved in appending to a xls file is knowing its last row, to avoid overwriting data with the xlswrite command. I'd suggest taking a look at this file

Clicking a drop down option in iFrame with VBA excel

淺唱寂寞╮ 提交于 2021-02-17 02:15:09
问题 I'm trying to click the drop down option "Approve the Deal" in the below code. I have solid VBA backround but this is my first attempt at HTML automation with VBA excel. Thus far I'm able to navigate and login to the website, select the deal that needs to be approved, and show the drop down. However, I cannot figure out how to click the drop down option/trigger the event. I believe my gaps are dealing with the iFrame and/or table (something I did not have to deal with in the code to this

VBA Excel add new sheet with number based on the previous sheet created

可紊 提交于 2021-02-16 22:58:42
问题 I have the Sheet called "Area Map 1". I want to create the button, which will add the new sheet for me (copy the "Area Map 1") with the name Area Map 2. The button is going to add one sheet only. It means, that it can be used repeatedly if we need to create more sheets. However, if I use this button once, then my last existing sheet under this name is "Area Map 2". Using the button again will result from the error "The name is already taken, try the different one". What should I improve in

Natural or Human Sort order

喜你入骨 提交于 2021-02-16 21:56:56
问题 I have been working on this on for months. I just cannot get the natural (True alpha-numeric) results. I am shocked that I cannot get them as I have been able to in RPG since 1992 with EBCDIC . I am looking for any solution in SQL, VBS or simple excel or access. Here is the data I have: 299-8, 3410L-87, 3410L-88, 420-A20, 420-A21, 420A-40, 4357-3, AN3H10A, K117GM-8, K129-1, K129-15, K271B-200L, K271B-38L, K271D-200EL, KD1051, KD1062, KD1092, KD1108, KD1108, M8000-3, MS24665-1, SK271B-200L,

Select an option from a dropdown in IE and triggering a function

半城伤御伤魂 提交于 2021-02-16 21:22:17
问题 So, I am a newbiew in IE Automation for VBA.I will try to be very specific about my question. Recently, I have been trying to login to a website and then select a month from a dropdown list. I am able to select an option from the dropdown. However, when I click on the search Button, Results appear not for the values which I selected using VBA, but for the values that were originally there on the webpage. Normally, if one goes to the website, he has to click on the dropdown and select the