vba

Run-time error '1004' when using fully qualified cells in range object

拜拜、爱过 提交于 2021-02-04 08:16:01
问题 I am trying to copy values from one workbook and paste them into another using the cells property of the range object. How do I properly state range references so that I am not receiving a '1004' runtime error? I'm working on Excel 2013, and I am running the code in "Practicebook" workbook with an active worksheet. I've researched many similar problems like this one, Run time error 1004 in Range(Cells()), but they have not helped me. I've made sure my references are fully qualified. Sub

Excel VBA to activate selectitem in web and go web for data

醉酒当歌 提交于 2021-02-04 08:10:26
问题 I'm very fresh to excel VBA. I tried use all potential solutions in the internet for activate selectitem in web and get data table but it didn't work. My Excel VBA code and Javascript is below. Sub GetQuarterFinancials() Dim ie As Object, URL As String URL = "https://www.marketwatch.com/investing/stock/aapl/financials" Set ie = CreateObject("internetexplorer.application") With ie .Visible = True .navigate URL Do While .Busy DoEvents Loop Do While .readyState <> 4 DoEvents Loop Set ticker = ie

Convert Excel Text to Time

假装没事ソ 提交于 2021-02-04 06:58:05
问题 I have to convert some formatted text to excel time, but I could not find a solution by myself. Here are some examples of the input text and how it should be converted: - 1 Hour 14 minutes ==> 01:14:00 - 1 minute. ==> 00:01:00 - 1 Hour 1 minute ==> 01:01:00 - 2 minutes ==> 00:02:00 - 3 minutes 12 seconds ==> 00:03:12 - 29 seconds ==> 00:00:29 Observe that some times there are both minutes and seconds and some others only one of minutes/seconds, besides some times you find minutes (plural) and

Convert Excel Text to Time

こ雲淡風輕ζ 提交于 2021-02-04 06:55:49
问题 I have to convert some formatted text to excel time, but I could not find a solution by myself. Here are some examples of the input text and how it should be converted: - 1 Hour 14 minutes ==> 01:14:00 - 1 minute. ==> 00:01:00 - 1 Hour 1 minute ==> 01:01:00 - 2 minutes ==> 00:02:00 - 3 minutes 12 seconds ==> 00:03:12 - 29 seconds ==> 00:00:29 Observe that some times there are both minutes and seconds and some others only one of minutes/seconds, besides some times you find minutes (plural) and

Convert Excel Text to Time

坚强是说给别人听的谎言 提交于 2021-02-04 06:55:00
问题 I have to convert some formatted text to excel time, but I could not find a solution by myself. Here are some examples of the input text and how it should be converted: - 1 Hour 14 minutes ==> 01:14:00 - 1 minute. ==> 00:01:00 - 1 Hour 1 minute ==> 01:01:00 - 2 minutes ==> 00:02:00 - 3 minutes 12 seconds ==> 00:03:12 - 29 seconds ==> 00:00:29 Observe that some times there are both minutes and seconds and some others only one of minutes/seconds, besides some times you find minutes (plural) and

Get a WeekNumber's end date using excel macro

亡梦爱人 提交于 2021-02-04 06:51:15
问题 I have 3 columns: Year, Weeknum, WeekRange. i'd like the WeekRange column to display the Start and End Dates based on the Year and WeekNum values. I found a code that calculates the Start Date and it works fine but i cant find anything that shows how to get the End Date. here's the code i found(assuming the WeekNumber is 4 and the Year is 2020) Function WeekStartDate(Optional intMonth As Integer = 1, _ Optional intDay As Integer = 1) Dim FromDate As Date, lngAdd As Long Dim WKDay, WDays As

Application.OnTime running when it shouldn't

℡╲_俬逩灬. 提交于 2021-02-04 06:38:29
问题 I've written a script which generates a Lotus Notes email to publish data at certain time intervals. This script is Macro2 - Macro5. Macro 2 - Macro 5 are all identical, but I've duplicated the script under different subs to try and diagnose my problem. The problem that I am experiencing is sometimes at for instance 8pm, 4 emails will be generated. One email will be triggered correctly by Macro 5, but the other emails sent at 8pm have been triggered by Macro 2. I know this because I've added

Application.OnTime running when it shouldn't

佐手、 提交于 2021-02-04 06:35:02
问题 I've written a script which generates a Lotus Notes email to publish data at certain time intervals. This script is Macro2 - Macro5. Macro 2 - Macro 5 are all identical, but I've duplicated the script under different subs to try and diagnose my problem. The problem that I am experiencing is sometimes at for instance 8pm, 4 emails will be generated. One email will be triggered correctly by Macro 5, but the other emails sent at 8pm have been triggered by Macro 2. I know this because I've added

ThisWorkbook Workbook_Open fails to show userform if Excel or Word already open

社会主义新天地 提交于 2021-02-04 06:24:59
问题 I use Office365. I have an Excel file called Test.xlsm which contains a userform named frmMain. In the ThisWorkbook object and then in the Workbook_Open event I have the following code: Private Sub Workbook_Open() Worksheets("Main").Activate frmMain.Show End Sub It is meant to launch (show) the frmMain userform every time the Test.xlsm file opens. However, if another Excel or Word file is already open, the frmMain user form fails to launch/show. Is there a way to have an Excel or Word file

Automation of iTunes connect VBA

自古美人都是妖i 提交于 2021-02-02 09:57:24
问题 I am trying to automate a report through VBA. I have worked in VBA but not able to login in iTunes website through codes. Someone told me that it is written in IFrame, but i have no idea. Even i am not able to put my username in input box of login page. https://itunesconnect.apple.com/login Dim HTMLdoc As HTMLDocument Dim MyBrowser As InternetExplorer Sub check() Dim MyHTML_element As IHTMLElement Dim MyURL As String MyURL = "https://itunesconnect.apple.com/login" Set MyBrowser = New