Outlook Forwarding and Regular Expressions

I am trying to set a rule within Outlook that whenever I receive an email with a certain subject a script runs and parses through that emails body and returns a number that ranges from 4-6 characters long. For example 4444 or 123456. Each email com...
more »

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

Public array variable of variable size

I'd like to have a global array variable in Excel VBA whose array size depends on a second global variable. I'm trying something like this.. Public int1 As Integer Sub foo() int1 = '##read from ini file Public varArray(1 To int1) As Variant For...
more »

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

Variable Not Defined Error Enigma

I am trying to automate PowerPoint from Excel. Everything worked fine. I have the following code block that worked perfectly: Set MyTextbox = mySlide.Shapes.AddTextbox(1, Left:=myShape.Left - 3, Top:=42, Width:=myShape.Width + 6, Height:=10).TextFra...
more »

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

Column comparison error in VBA

Hello I am writing a macro that compares two columns on different sheets in excel. The macro is as follows: Sub Main() Application.ScreenUpdating = False Dim stNow As Date stNow = Now Dim arr As Variant arr = Worksheets("Sheet2").R...
more »

2017-01-19 19:01 (2) Answers

Copying sheets while preserving digital signatures

(Note: during preparing this post and testing solutions, I probably have already answered my own question. Just posting this in the hope anyone smarter than me can come up with something. Anyway, it's still a good resource for future searchers I gu...
more »

2017-01-19 16:01 (0) Answers

Sorting on four columns

I have the following sheet and code which at the moment are not working as it should be. What I want is to sort First column F, Then column B, Then column D, and last column E The data in column A:F is a dataset and therefore I need to make t...
more »

2017-01-19 11:01 (1) Answers

Set data structure in VBA

I'm looking for a set data structure to use in Excel VBA. What I found so far is Scripting.Dictionary which seems to be a map. Is there also something like a set in VBA? Basically I'm looking for a data structure that is efficient for finding out i...
more »

2017-01-18 14:01 (3) Answers

Programmatically press enter with Excel VBA

I am trying to programmatic press the enter key once a value has been set to specific cell: Private Sub TextBox1_Change() If TextBox1.Text = "ALC Test" Then Range("$F$2").Value = "17" ActiveWorkbook.RefreshAll End If If T...
more »

2017-01-18 14:01 (2) Answers

excel-vba - can't sum dictionary items in a loop

I create a dictionary with some items and I need to sum the various items for every key. But I can't. I post the code with some comments. Let me know if I have to add more deta Sub dict_sum() Dim dict as New Dictionary Dim i As Integer Dim pk As ...
more »

2017-01-18 14:01 (1) Answers

Hide characters in macro for password control

I have created a macro to insert an image, when an individual presses a button on the spreadsheet the below macro will run and a message box will appear for the individual to input a password, if correct the image will be inserted. This works fine bu...
more »

2017-01-18 12:01 (1) Answers

VBA browse file and make operations

Hello I am trying to write a VBA macro, which browses excel files and then makes operation in the files. The code I wrote is as follows: Option Explicit Sub SelctFile() Dim intChoice As Integer Dim strPath As String Dim i As Integer 'allow the use...
more »

2017-01-18 11:01 (1) Answers

Excel VBA For...Next

I'm a VBA newcomer. I wonder why does sum1() show 10 while sum2() show 11? Thanks in advance. Sub sum1() Dim x As Integer x = 0 For x = 5 To 5 x = x + x MsgBox x Next End Sub Sub sum2() Dim x As Integer x = 0 For x = 5 To...
more »

2017-01-18 05:01 (2) Answers