Can I get VBA equivalent of DateTime.Now.Ticks?

In VB within .NET I can use DateTime.Now.Ticks.ToString("x") to get a string ready for a multipart form boundary e.g. 8d4b7556f42792c I'm trying to get the same thing in VBA within Excel. In Excel VBA I can use DateTime.Now to get now in the format...
more »

2017-06-19 22:06 (1) Answers

VBA + Excel + Try Catch

In VBA I'm doing a simple script that records a version of a spreadsheet being used. Private Sub Workbook_Open() version = "1.0" Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") URL = "<WEB SERVICE>" objHTTP.Open "POS...
more »

2017-06-19 21:06 (1) Answers

Parsing Outlook Emails and Exporting to Excel VBA

I'm currently writing a VBA macros script run in Microsoft Outlook which should parse key information from emails and store them into an Excel spreadsheet. Right now, I am stuck on the logic of parsing and extracting what I want. Here is a short e...
more »

2017-06-19 21:06 (2) Answers

VBA - Print lines to a .txt file

i'm having issues while printing values in a text file. Whenever I have a date or numbers, I get an "Error 13"... I guess it's linked to my variables but I can't understand where the problem is. Sub SX_Externe_Generate_TXT() Dim WsCib As Worksheet D...
more »

2017-06-19 20:06 (1) Answers

How to Check Value of Cells in Range VBA

I am trying to take a range of cells (column B to be specific) and find the cells in that range that have a value less than zero and clear the contents of those cells. Is there a way to do this without looping through every single cell? The column is...
more »

2017-06-19 17:06 (3) Answers

VBA: Create an array of class module

I'm trying to create an array of my custom class, but it gives me this error: Run-time error '91': Object variable or With block variable not set Here is my code so far: Sub DBM_Format() Dim coreWS As Worksheet Dim WS As Worksheet Dim ...
more »

2017-06-19 15:06 (2) Answers

macro based on changing of a cell

I have found various solutions to the problem I have, but they require too much autonomy on my part: I'm writing my first ever visual basic program so I don't know much. I have tried these solutions, but they don't work, presumably because I'm messin...
more »

2017-06-19 15:06 (2) Answers

F1 key to run macro

How can I assign F1 key to macro in excel instead of 'excel help'? I see many answers to this question, but they do not work in excel 2013/2016. I need solutions like this, but for new Excel: https://www.extendoffice.com/documents/excel/1798-excel-d...
more »

2017-06-19 13:06 (2) Answers

More control over XlFind

I'm using a script to allow users to find a serialnumber in a column of an excel sheet. A problem however is the flexibility of the search. The serialnumbers may occur as the following examples: "12345678      ", "1 345678        ", "1...
more »

2017-06-19 12:06 (3) Answers

Atomicity in Excel VBA

I have the following code in a Form Module in an xlsm: Public Sub DoModal() ' Note: Called by LaunchHelper which is associated with F12 in Workbook_Open Dim ewsActive As Worksheet: Set ewsActive = ThisWorkbook.ActiveSheet If ewsActive Is Ove...
more »

2017-06-19 11:06 (2) Answers

Store and access files in XLSM package structure

as part of an excel based VBA project that I am working on I have a reliance on external files. To date I have managed to get around this by either embedding the files or sending them with the spreadsheet. However as part of this project I have the ...
more »

2017-06-18 22:06 (0) Answers

VBA macro to copy content of an email to Excel

I would like to create a macro to copy the content of a newsletter to Excel. I receive a daily newsletter with the following structure: ^^^^^^^^^^^^^^^^^^^^^^ Subject: Daily News from Mickey Mouse Content: 10 news today (first row with the exact ...
more »

2017-06-18 22:06 (0) Answers

Calculations for every unique/distinct values

I have a very large data set that I need to work with and in my calculations three columns are of interest. Let's call the different columns [A], [B] and [C]. In [A] I have a list of different company names, where each company name might occur severa...
more »

2017-06-18 21:06 (2) Answers

Wildcard autofilter criteria using an array

I've read various threads on this but can't seem to get my code to work with it. It seems you're unable to have more than 2 wildcard criteria in an array to use as autofilter criteria. No idea why that is, but my code is currently this: Sub Strip_De...
more »

2017-06-18 03:06 (0) Answers

How to resolve error 400 in excel-vba

I am writing an excel-vba to find and delete entire row if having blanks cell in a particular column. My macro is working fine if there is at least one blank cell but showing error 400 if there is no blank cell. My code is Sub GPF_Sign() Dim i As In...
more »

2017-06-17 19:06 (3) Answers

Compare different ranges with bracket notation

I want to compare range A2 with N2, A3 with N3 , A4 with N4 and want the output in L2 as True/False for the compared result of A2 vs N2 and the comparison result of A3 with N3 has to be in L3 and like that. Also the next comparison between N2 with N...
more »

2017-06-17 08:06 (2) Answers

Using an array for autofilter criteria

I have the below code which will delete rows based on criteria in column I: Sub Strip() Dim rng As Range With ActiveSheet .Columns("I").AutoFilter Field:=1, Criteria1:="=70-79%", VisibleDropDown:=False Set rng = .AutoFilter....
more »

2017-06-17 05:06 (1) Answers