excel-vba-mac

vba mac connect to sql server with ActualTech odbc Driver

北城余情 提交于 2019-12-05 18:40:52
I have been working on my problem for a while now and I don't really seem to find an accurate and working answer, so here I am... I'm a newby with vba I have to admit....... My problem is the following: I'm working on Mac OS X Yosemite with ms office 2011 and I'm trying to connect my Excel Workbook to a sql-database. This has to be done through vba as later on I want to read data from the sql-database as well as write data to the database. I couldn't find a way to establish a connection to that database. I even downloaded the actualtech odbc driver and setup my dsn (not sure if I did it right

Load contents of CSV file to array without opening file [closed]

为君一笑 提交于 2019-12-05 06:08:50
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have a requirement to collate over 6000 csv files into a single csv document. The current VBA process is: 1. Open individual CSV data file 2. Load contents of file to array based on number of rows 3. Close individual CSV file 4. Process array In order to improve efficiency of

VBA cDate not working on Mac excel 2011(14.7.1)

夙愿已清 提交于 2019-12-05 01:51:17
问题 I am trying to convert a date into long using VBA script. Below is the code snippet Sub test() Dim str as string Dim d as variant str="1/1/2016" d=cdate(str) end sub The above snippet runs fine on windows but is giving me type mismatch error on MAC. Is there any turnaround to convert a valid string in a date. 回答1: Your code did work on my local OS X machine with Excel. I have different region settings, though. I would suggest try using the international date format ("YYYY-mm-dd"). Sub Main

How to check which line of VBA code is causing errors

99封情书 提交于 2019-12-05 00:48:01
I am trying to debug a long code I wrote and I need to step line by line. The thing is I am on a mac and don't know how to use an F8 in that case. Could anyone tell me how can I do that otherwise and how do I know which line is causing problems with execution? To check which line is giving you the error, you can use the ERL property. See this sample code below. Sub sample() Dim i As Long On Error GoTo Whoa 10 Debug.Print "A" 20 Debug.Print "B" 30 i = "Sid" 40 Debug.Print "A" 50 Exit Sub Whoa: MsgBox "Error on Line : " & Erl End Sub For this to work, you will have to number the code lines as I

Edit VBA UDF to sum numbers in parenthesis while ignoring words in parenthesis

廉价感情. 提交于 2019-12-04 05:31:53
问题 I have a UDF that will look in a given cell for numbers inside of parenthesis then sum all numbers inside of parenthesis in a given cell, it works well 90% of the time but when I have something inside of parenthesis that is not a number i.e a word or phrase, it will return #VALUE! I'm trying to fix this so that it will ignore words etc that are inside parenthesis. Also for some reason, having a "." after parenthesis makes it so that the numbers in the parenthesis before the "." are ignored

Load contents of CSV file to array without opening file [closed]

人盡茶涼 提交于 2019-12-03 20:28:37
I have a requirement to collate over 6000 csv files into a single csv document. The current VBA process is: 1. Open individual CSV data file 2. Load contents of file to array based on number of rows 3. Close individual CSV file 4. Process array In order to improve efficiency of the code and processing, I was hoping there may be a method to load the data from the individual CSV files into an array without opening and closing every single file. I am using Excel 2011 for Mac. Ok I am assuming that All 6000 files have the same format. My Test Conditions I have a folder called C:\Temp\ which has

VBA cDate not working on Mac excel 2011(14.7.1)

余生长醉 提交于 2019-12-03 16:43:25
I am trying to convert a date into long using VBA script. Below is the code snippet Sub test() Dim str as string Dim d as variant str="1/1/2016" d=cdate(str) end sub The above snippet runs fine on windows but is giving me type mismatch error on MAC. Is there any turnaround to convert a valid string in a date. Your code did work on my local OS X machine with Excel. I have different region settings, though. I would suggest try using the international date format ("YYYY-mm-dd"). Sub Main Dim str as String Dim d as Variant str = "2016-01-01" d = CDate(str) End Sub Alternatively, you could try "Jan

Date for VBA not working in Excel 2011?

∥☆過路亽.° 提交于 2019-12-02 13:33:31
问题 Here is my code, I am attempting, which works BTW on a PC, but not on a Mac, to run this code and have an excel sheet created, named, add a tab, change the color of said tabs, change the name of said tabs, and then transpose the data while maintaining the format of the cells and width and height of the cells to the new worksheet. This works, on a PC.... but when I get onto a Mac, it doesn't. I go into References, and this is what I see. I see Ref Edit Control, and Microsoft Scripting Runtime

Remove entire row based on match?

落爺英雄遲暮 提交于 2019-12-02 12:26:05
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: This will work, very fast for what you are looking to do as it doesn't involve ANY loops. Sub DeleteDuplicates() Dim

AppleScript to combine multiple Excel files into a single worksheet

痞子三分冷 提交于 2019-12-02 08:32:57
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 code I came up with. It does open correctly each file, but the copy/past operation is just not happening