excel-2013

Status Bar Progress Meter not showing messages

╄→гoц情女王★ 提交于 2019-12-02 09:35:22
I'm trying to put together a 'Status Bar Progress Meter' to help the user when loading a lengthy macro. I've carried out some research and found this to be the type that I'd like to use. The problem I have is that the progress bar doesn't move across the Status Bar and the first and last messages i.e. "Working" and "All Files Extracted" are not shown. Where have I gone wrong? Private Sub btnFetchFiles_Click() Dim j As Integer iRow = 20 fPath = "\\c\s\CAF1\Dragon Mentor Group\Dragon Scripts\Current\April 2015" If fPath <> "" Then ' make StatusBar visible Application.DisplayStatusBar = True Set

Unable to refresh VBA code programatically

雨燕双飞 提交于 2019-12-02 09:01:47
问题 I have a routine that looks like this: Private Sub RefreshByName(strFileType As String) Dim strFile As String strFile = Dir(".\*." & strFileType, vbNormal) Do While Len(strFile) > 0 Dim strCompName As String Dim vbComp As Object strCompName = Left(strFile, Len(strFile) - 4) 'Fails here vbComp = ActiveWorkbook.VBProject.VBComponents(strCompName) ActiveWorkbook.VBProject.VBComponents.Remove vbComp ActiveWorkbook.VBProject.VBComponents.import (strFile) strFile = Dir Loop End Sub According to

Converting large time format to decimal in excel

拈花ヽ惹草 提交于 2019-12-02 08:45:35
I'm trying to convert a large time value in excel to a decimal number for hours. I currently have a column adding up "Ready time" for a call centre which is 3545:20:02 as a SUM. I now want that to show me the same hours in a decimal format e.g. 3545.333 as it's used in another calculation. For reference, when I convert the above time to a General excel value, it is 147.7222454. The formula I've been using is: =IFERROR((DAY(M54)*24) + HOUR(M54) + (MINUTE(M54)/60),0) and has been working fine for smaller time values. Thanks in advance! Excel counts in days (1 day = 1) so for hours you just

Setting value of a UserForm Combobox

天涯浪子 提交于 2019-12-02 07:24:48
(Narrowed down from my broader question at enter link description here as advised in meta .) I have a userform. On that userform are several comboboxes for selection year, month and day. The day combobox is populated with numbers up to 28, 29, 30 or 31 depending on what year and month is selected. To avoid selecting things like the 31st of February, I'd like to check if the selected day value exceeds the maximum for that month, and reduce it appropriately. At the moment I've tried these options: If Me.Combo_Day.Value > iMaxDate And iMonthNo > 0 And Not Me.Combo_Day.Value = "" Then Me.Combo_Day

How can Office Add-in (Task-pane) not display by default

眉间皱痕 提交于 2019-12-02 05:33:56
I have an Task-pane Office Add-in ( https://msdn.microsoft.com/en-us/library/office/fp123523.aspx ) on registered Office 365 Site. When the user opens a spreadsheet from a document library on that site, then in edit mode, can use the "Office Add-ins" from the Insert menu to insert my add-in to the Spreadsheet. My add-in helps them population and update data on the spreadsheet. They then save the spreadsheet back with the updated data. Now, the next time they open that spreadsheet, my task-pane shows up again. Is there any the task pane can not start opened? I would like the user to explicitly

Excel - How to count number of rows in range (i.e. various columns) that contain certain string?

三世轮回 提交于 2019-12-02 05:13:42
I have a list A of strings and I want to see if and if yes in how many rows each string is represented in range B. My data looks something like this: List A: E 1 aaa 2 bbb 3 ccc Range B: A B C 1 aaa --- --- 2 bbb ccc bbb 3 aaa --- --- My desired result would be that in list A for "aaa" it would tell me 2, for "bbb" 1 and for "ccc" 1. Have been trying to do this with the below array formula but it doesn't seem to be working: =SUM(IF(COUNTIF(Range B,List A($A1)>0,1,0)) As much as I like to avoid encouraging the use of the volatile OFFSET¹ function , it seems the most likely candidate in this

Excel 2013 - 1004 runtime error Refresh Query Table BackgroundQuery:=False

荒凉一梦 提交于 2019-12-01 11:09:14
I have run into an issue with Excel 2013 when refreshing a QueryTable with BackGroundQuery set to False (BackgroundQuery has to be set to false for our purposes). When a query is provided that returns no data the 1004 runtime error occurs, the most common cause of no data being returned is that there are no records for a specific time frame or on a specific resource. My co-workers and myself have been trying to work around this issue but have found no solution yet and we have further found nothing that indicates that there was a change in how Excel handles refreshing query tables. A sample bit

Excel 2013 - 1004 runtime error Refresh Query Table BackgroundQuery:=False

偶尔善良 提交于 2019-12-01 09:31:58
问题 I have run into an issue with Excel 2013 when refreshing a QueryTable with BackGroundQuery set to False (BackgroundQuery has to be set to false for our purposes). When a query is provided that returns no data the 1004 runtime error occurs, the most common cause of no data being returned is that there are no records for a specific time frame or on a specific resource. My co-workers and myself have been trying to work around this issue but have found no solution yet and we have further found

Loop through folder, renaming files that meet specific criteria using VBA?

倖福魔咒の 提交于 2019-12-01 05:24:46
I am new to VBA (and have only a bit of training in java), but assembled this bit of code with the help of other posts here and have hit a wall. I am trying to write code that will cycle through each file in a folder, testing if each file meets certain criteria. If criteria are met, the file names should be edited, overwriting (or deleting prior) any existing files with the same name. Copies of these newly renamed files should then be copied to a different folder. I believe I'm very close, but my code refuses to cycle through all files and/or crashes Excel when it is run. Help please? :-) Sub

Loop through folder, renaming files that meet specific criteria using VBA?

馋奶兔 提交于 2019-12-01 04:06:47
问题 I am new to VBA (and have only a bit of training in java), but assembled this bit of code with the help of other posts here and have hit a wall. I am trying to write code that will cycle through each file in a folder, testing if each file meets certain criteria. If criteria are met, the file names should be edited, overwriting (or deleting prior) any existing files with the same name. Copies of these newly renamed files should then be copied to a different folder. I believe I'm very close,