excel-2013

How do I concatenate cell values and text together using Excel VBA?

依然范特西╮ 提交于 2020-01-22 19:29:25
问题 I have a repetitive task I'd like to automate instead of using the =Concatenate function all the time. Here's my code so far: Cells(2, 5).Value = Cells(2, 1).Value&" - "&Cells(2, 2).Value Unfortunately this results in the "Compile error: Expected: end of statement" error, which highlights the " - ". How can I sandwich that text, " - ", between those two values? 回答1: Cells(2, 5).Value = Cells(2, 1).Value & " - " & Cells(2, 2).Value 回答2: @Joshua provided an answer for you situation. Another

How to accept 9 first characters in excel formula?

爷,独闯天下 提交于 2020-01-21 18:53:46
问题 I am trying to get this sort of result, where I check on sheet1 if the first three numbers on column A are found anywhere in the sheet2's column A. If the numbers are found then on column B excel prints Yes and if it is not found excel prints No: Sheet 1 A B =12300 Yes =56700 Yes =89200 No Sheet 2 A =12345 =56789 =44498 The formula that I have at the moment on sheet1 col B is =IF(ISNUMBER(MATCH(A1;Sheet2!A:A));"Yes";"No") How to add the possibility to check that it takes into consideration

ActiveX Button Renaming

做~自己de王妃 提交于 2020-01-17 13:49:47
问题 First, I am aware of the nearly ubiquitous issue with ActiveX controls and the Dec 2014 MS Excel update. This appears to be different than the common symptoms, but it may be related. Symptoms: Open an existing excel sheet that contains an ActiveX control. Click the button and nothing happens (macro does not launch) Investigation shows that the button name has changed from "BtnMacroLaunch" to "CommandButton3" I open the file on other users machines and the button has NOT been renamed and it

RT 1004 - Method 'Range' of object '_Worksheet' failed

拈花ヽ惹草 提交于 2020-01-17 03:10:28
问题 I am getting a RT 1004 - Method 'Range' of object '_Worksheet' failed error on this line: LRWGM = MANs.Range("A" & Rows.Count).End(xlUp).Row from the code below. Not sure why. Any idea's? Below is the full code: Sub Copy_To_Template() ' ' The following is a list of the Source Workbooks and Worksheets Dim PRM1 As Workbook ' source workbook 1 contains current list of unassigned Problem Tasks Set PRM1 = Workbooks("BCRS-PTASKS Unassigned.csv") Dim PRM2 As Workbook ' source WorkBook 2 contains all

Excel VBA : WorkSheet_FollowHyperlink is not getting called for Shape Object ( msoPicture )

牧云@^-^@ 提交于 2020-01-16 02:24:08
问题 I need to have a macro executed when someone clicks on the shape in the worksheet which is a picture. The macro intention is to display more information regarding the shape on which the user clicked. EDIT: I also needed an information display during mouse-rollover, hence used hyperlink method. I followed the method outlined in the MSDN , but the macro just doesn't seem to run. My Macro is as follows: Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) MsgBox "Source: Target.Range

Excel 2013 macro to show only specific rows based on one cell value

扶醉桌前 提交于 2020-01-15 12:31:07
问题 i am new to excel macros and vba. I have an excel file with about 300000 rows in first sheet where there are item identifiers in first column(they might be several which has the same value), and about 1000 rows in second sheet(first column also contains item identifiers but they are unique here). i need to write a macro that hides rows in first sheet based on the second sheet. i mean i need to loop throw all rows in first sheet and if first cell value does not match any cell of first column

be careful parts of your document may include personal information that cannot be removed by the Document Inspector

倖福魔咒の 提交于 2020-01-12 02:33:06
问题 I use Excel 2013 and Power View and SQL Server 2008 R2 . After create my Data Source and my chart in Excel When I want save my Excel file I get this message be careful parts of your document may include personal information that cannot be removed by the Document Inspector. What is this warning and how I can remove this message? What are personal information that exist in my Excel File . 回答1: Also ran into that. It seem, after running the Document Inspector in Excel, it will show you this

Status Bar Progress Meter not showing messages

大兔子大兔子 提交于 2020-01-11 14:24:28
问题 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

Status Bar Progress Meter not showing messages

隐身守侯 提交于 2020-01-11 14:24:06
问题 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

Excel Custom Task Pane not showing

放肆的年华 提交于 2020-01-10 19:51:46
问题 I'm showing a custom task pane in an excel VSTO add-in, I'm building it and showing it as thus: var ctrl = new CellTaskPane(); var pane = CustomTaskPanes.Add(ctrl, "Custom Sheet"); pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight; pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange; pane.Visible = true; This is being done in the ThisAddin.cs file and it working just fine on my machine, both under a Debug session and with the