excel-vba-mac

AppleScript to combine multiple Excel files into a single worksheet

隐身守侯 提交于 2019-12-20 06:32:09
问题 I am not an expert in AppleScript, so I've ben trying to find an example of AppleScript code that can successfully process a batch of Excel files (each one with a single worksheet), copying the content of each one into a single destination sheet. This is the pseudo code that I had in mind: pick source folder with Excel files; pick destination Excel file; for each file within the source folder: copy data from default sheet; paste data into destination sheet's first unused row end This is the

Remove entire row based on match?

左心房为你撑大大i 提交于 2019-12-20 05:55:09
问题 Need to remove multiple rows within a CSV file in Excel based on a match in column L on sheet1 with column A on sheet2. The content is email addresses. How can I achieve this? So, if sheet2 column A has an email address that matches any of the email addresses in sheet1 - Column L, than it should remove the entire row from sheet1 where that email address is located. Sheet1 below: Sheet2 below: @mehow, here's the image I get when I run your code as a module: 回答1: This will work, very fast for

Is there a way to get ADODB to work with Excel for Mac 2011?

孤街浪徒 提交于 2019-12-17 21:59:17
问题 I can not seem to get my Excel workbook (using ADODB) to work with Excel Mac 2011. I am using ADODB code. Are there add-ins available? Even from a third-party? Has anyone gotten this to work? 回答1: Are there add-ins available? Even from a third-party? Hope these download links helps? ODBC drivers that are compatible with Excel for Mac Quoted from the MSKB in case the link dies ODBC drivers that are compatible with Excel for Mac If you want to import data into Excel for Mac from a database, you

Excel 2013 VBA Clear All Filters macro

▼魔方 西西 提交于 2019-12-17 04:59:25
问题 It seems older macros are not working. I have proper securtiy set to run VBA macros but when I have tried a few methods for clearing ALL filters on a worksheet, I get a compile error. Here is what I have tried: Sub AutoFilter_Remove() 'This macro removes any filtering in order to display all of the data but it does not remove the filter arrows ActiveSheet.ShowAllData End Sub I have buttons on the sheets to clear all filters for ease of use for users since the sheets has a lot of columns that

VBA Shell function in Office 2011 for Mac

浪子不回头ぞ 提交于 2019-12-17 02:49:12
问题 I am trying to launch a shell script from a VBA macro in Word 2011 for Mac that will run in a Terminal window. I have tried using both the Shell function and the MacScript function, but the VBA interpreter doesn't seem to be able to find the script in either case. According to the VBA reference documentation, the following should work: RetVal = Shell("Macintosh HD:Applications:Calculator.app", vbNormalFocus) This produces a run-time error 53 'File not found'. Any suggestions? 回答1: The Shell()

VBA If Then Or Statements

我们两清 提交于 2019-12-14 03:11:50
问题 VBA beginner here. I'm trying to do a pretty simple if/then statement in VBA 2003, but I'm running into the issue. My code reads: Dim var as Integer If var = 1 or 2 Then 'Do stuff Else MsgBox ("error") I keep running into the issue with the or statement. If I change it to var = 1, the code runs without a hitch; if I rewrite it as If var = 1 or var = 2 then it works fine. But as I would like to expand this, being able to write this in a more cohesive way would be great. What am I missing? :(

Why can't this VBA Excel code read duplicates?

送分小仙女□ 提交于 2019-12-13 11:14:57
问题 r = 11 Do While Not tgtWSheet.Cells(r, 2) = "0" If tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 1, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 2, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 3, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 4, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 5, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 6, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 7, 2) Or tgtWSheet.Cells(r, 2) = tgtWSheet.Cells(r + 8, 2) Or tgtWSheet.Cells(r, 2)

How To Open Non-Excel File with Excel Mac VBA

ⅰ亾dé卋堺 提交于 2019-12-13 05:08:32
问题 There are numerous Q&A's for Excel WINDOWS, but none for Excel MAC that specifically answer this question. Using Excel Mac 2011 VBA, how do I open a non-Excel file using the file's default app? After much research and testing, I figured out the answer. See below. 回答1: This works running Microsoft Excel 14.7.2 (14.7.2) on macOS 10.12.6. ```vb Sub open_file() Dim scriptStr As String Dim hfsPath As String hfsPath = "~:Documents:Test File To Open From Excel.txt" '--- Create AppleScript to Open

run time error 1004 in excel 2010 Refresh BackgroundQuery

纵然是瞬间 提交于 2019-12-13 00:38:36
问题 I am tring to write a script in vba for importing several text files to excel (one sheet) and than draw them on one graph. I am facing a problem in Refresh BackgroundQuery commant and falls on 1004 run time error. How can i work it out? Thanks, Eyal Here is my code: Sub fring1() Dim fpath As String Dim fname As String Dim i As Integer fpath = "C:\Users\epinkas\Desktop\Yossi\" fname = fpath & "*.txt" Name = Dir(fname) While Name <> "" With Sheet1.QueryTables.Add(Connection:= _ "TEXT;fpath &

Mac Excel 2016 “Run-time error '429': ActiveX component can't create object”

允我心安 提交于 2019-12-12 05:59:37
问题 I have a large data of website scraped data (all configurable products with multiple colour and sizes) which I need to convert to a format which can be uploaded to a Magento website and I want to use Excel (Mac) to step by step convert the data from the scraped format to the Magento import format. I am trying to extract a list of unique products item code from the scraped original data so I can search and extract first each product and then convert each product to the required format through