excel-vba-mac

Excel FindNext function

浪子不回头ぞ 提交于 2019-12-25 03:48:42
问题 Find Next question for Stack Overflow I have what's turning into a long VBA script. The objective is to let the user type in all or part of a last name and first name, then edit the record. The problem is that the data may have duplicate search keys. For example, John Smith's key ID would be SmithJohn. Suppose there is also a Ray Smith in the table (ID = SmithRay). If the user searches for Smith, John Smith will get the hit. If the user actually wants Ray Smith, I've given them a button to go

Excel 2011 - How to change output of textJoin from value of cell, to the cell name, so I can put it in Sum() to add those values

拥有回忆 提交于 2019-12-25 01:05:51
问题 I'm using the textJoin UDF listed below to combine values from various rows into a single cell; it displays each value. However, I want to know if I can manipulate the output of this UDF so that instead of simply displaying the values I can add the values and get the sum of the values. Or ideally, if I can just modify variables to instruct it to ADD the values. Does anyone know if this UDF (which I didn't create) can be instructed to output the Cell names (A2, B2, C2), and if so can I put

VBA export worksheet as PDF (Mac 2016) error

梦想的初衷 提交于 2019-12-24 22:07:57
问题 I am struggling to export my worksheet as PDF. Here is my code, FYI I am using Office 2016 for MAC Sub saveactiveworkbook() Dim FileName As String Dim FolderName As String Dim Folderstring As String Dim FilePathName As String ActiveSheet.PageSetup.Orientation = xlLandscape FolderName = "TestVBA" FileName = "DV" & ".pdf" Folderstring = "/Users/Vallier/Documents/Test/TestVBA" FilePathName = Folderstring & Application.PathSeparator & FileName ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF,

Is there an alternative to Scripting.FileSystemObject in Excel 2011 VBA for the mac?

不想你离开。 提交于 2019-12-24 09:28:10
问题 The answers to How can I install/use “Scripting.FileSystemObject” in Excel 2011 for MAC? seem to indicate that using Scripting.FileSystemObject in Excel 2010 for the mac is not possible. What other alternative is available so I can: get a collection of all Excel files in a specific directory iterate through each worksheet within each file and export it to a .csv file Currently this is a six-step process for each file: --how to create CSV files for all worksheets in a file: 1. open file 2.

Test SQL Server Connection

风流意气都作罢 提交于 2019-12-24 00:39:08
问题 I built an Excel-based tool that uses ODBC connections and querytables to pull data from a SQL Server (2014). This tool has to be compatible with Mac Office 2016 (hence the ODBC and querytables). I'm struggling with testing whether the user can connect to the SQL Server. With the ODBC connection, if it fails to connect, a SQL Server error login dialog opens and then a login dialog opens before my error handling can take effect. Every solution to this issue that I found uses either ADODB

Excel VBA - RemoveDuplicates method does not work with Mac

允我心安 提交于 2019-12-23 20:55:26
问题 I have below piece of code to remove duplicates from a sheet by looking into two columns (column 3 & 5). lRow = .Cells(Rows.Count, "A").End(xlUp).Row '.Range("A1:BR" & lRow).RemoveDuplicates Columns:=Array(3, 5), Header:=xlYes .Range("$A$1:$BR$" & lRow).RemoveDuplicates Columns:=Array(3, 5), Header:=xlYes It works fine in Windows but unfortunately not on Mac. Can anybody please suggest me what do I need to change here? 回答1: This piece of code will create a list of unique values and copy into

vba excel shape

ぃ、小莉子 提交于 2019-12-23 19:01:40
问题 I've used a small subroutine to insert a picture into my sheet by ActiveSheet.Pictures.Insert(URL).Select This works fine with Excel 2003 (Windows), but does not work with Excel 2011 (Mac) any more. Therefore I modified my subroutine (like proposed http://www.launchexcel.com/google-maps-excel-demo/), but the subroutine stops at theShape.Fill.UserPicture URL with the error message "-2147024894 (80070002) Fehler der Methode UserPicture des Objekts FillFormat" The rectangle is green! Sub Q1()

Launch a Google search from VBA Macro on Mac

最后都变了- 提交于 2019-12-23 17:27:06
问题 Just up front, I'm not a true programmer. I work in editing, and our company uses many macros to streamline our process and functionality (lots of findReplace, identifying inconsistent spelling/spacing conventions, etc.). That being said, I've begun to pick up some things on how the VBA editor works on Microsoft Word. We have a Fetch macro (originally created by Paul Beverley) that works amazingly for all of the employees who use PC. It takes the highlighted term in the document,

ActiveSheet vs. WorkSheet

这一生的挚爱 提交于 2019-12-22 18:34:17
问题 I'm using Excel for Mac 2011, and I have a couple Check Boxes in one sheet. I'm trying to automate them with the following code: Private Sub CheckBox12_Click() Dim ws As Worksheet Set ws = ActiveSheet With ws If .Shapes("CheckBox12").OLEFormat.Object.Value = xlOn Then .Range("CK1").EntireColumn.Hidden = False Else .Range("CK1").EntireColumn.Hidden = True End If End With End Sub This code gives me the error: Run-time error 445 Object does not support this action. However if remove ws and just

Create Word file from Excel 2011

China☆狼群 提交于 2019-12-22 13:03:11
问题 The usual approach to create a Word document from Excel VBA: Set WD = CreateObject("Word.Document") results in an error when run with Excel 2011. Any idea how a Word document can be created in Excel 2011 with VBA? (I do not want to use AppleScript as I want the program to be able to run on PCs also.) 回答1: The following code, based on the suggestion by bretville, seems to work both on mac (tested on Excel2011) and on pc (tested on Excel2007) and can be run repetedly, thus allowing creation of