VBA To Add Formula To Cell

I am attempting to write some VBA which will add header text to 3 cells then fill a formula all the way down to the last row. I have written the below, which writes the headers no problems, but when it get's to my first .Formula it throws a App...
more »

2017-03-23 23:03 (4) Answers

Private Sub ComboBox1_Click() loop

I have a code for a ComboBox, whose purpose is to write the value of the ComboBox after selecting its value and then to reset the ComboBox. The code is as follows: Private Sub ComboBox1_Click() Dim valor As String Dim celda As Range Set celda ...
more »

2017-03-23 21:03 (3) Answers

VBA Dictionary is Duplicating Keys

having trouble and need some help. I have created a simple example to learn dictionaries in VBA and have already run into an issue. I have the following set up: I am trying to loop over the keys, adding in the key and item. If the key exists, I wa...
more »

2017-03-23 20:03 (1) Answers

Set a new specific range in VBA

I'm trying to set a new range to VLookup required data. Lets say I have the following table of data as a PivotTable. The order of Sets can change, some Sets can be absent. With Find command (Match function doesn't work) I've found the row number ...
more »

2017-03-23 17:03 (2) Answers

How to pass boolean value from UserForm to Sub?

I am trying to close a UserForm if a person clicks the red x in the upper right hand corner. Here is my code so far. Public Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel As Boolean) If target.Column = 10 Then UserForm2.Show etc... ...
more »

2017-03-23 16:03 (2) Answers

How to reset variables or declarations vba

I want to thank everyone who gives answers on this site for the years of helpful information I've been able to derive from this forum. This is my first question ever posted: Here is the issue: I wrote the following code in order to create a continuo...
more »

2017-03-23 16:03 (0) Answers

Object Required Error , Array

I am getting the error 424 Object Required. I am very unfamiliar with arrays and assume it has something to do with that. I read a large number of the Object Required Error questions in this forum and tried the various suggestions, but none solved my...
more »

2017-03-22 22:03 (1) Answers

VBA and Regex with Named Groups

Converting a method I had in Java to VBA is turning out to be much more difficult than anticipated. I have a regex which can be found here It uses named object groups which after some research, do not appear to be supported by VBA. I'm attempting ...
more »

2017-03-22 20:03 (2) Answers

Placing Double Quotes Within a String in VBA

I'm having a hard time understanding how to place a double quote (") within a String in VBA. I know that I can easily do this using the char(34) function. I also understand that another way of doing this is to use 4 double quotes: """". All of this c...
more »

2017-03-22 20:03 (2) Answers

Dictionary.Exists Always False

I cannot for the life of my figure out why my dictionary is always returning false. Notes: I Debug.Printed the BuildVelocityLookup at lookup.Add and it is reading in the whole range. I Debug.Printed conUD and it is also holding the proper value....
more »

2017-03-22 16:03 (1) Answers

Massive offset to entire Excel sheet

I have one MS Excel file with 2 sheets. The first Sheet contains user input and the second one contains formula. Sheet1 +---+---+---+---+---+---+ | | A | B | C | D | E | +---+---+---+---+---+---+ | 1 | 1 | | 0 | 9 | | | 2 | 9 | 7 | | 3 | 2 ...
more »

2017-03-22 14:03 (1) Answers

Macro Excel: InputBox to key in rows and column

I have a coding which helps me to select the range I want. But what I need now is to key in a specific number of rows and column into the input box then the range will get selected. For example, I need 5 rows and 4 columns. I want to be able to key i...
more »

2017-03-22 02:03 (3) Answers

Array formula into range of cells

I'm trying to put an array formula into a range of cells ("B2:B10") The formula should return multiple results dependent on the value in cell A2. When I do it the normal way (ctrl, shift, enter) it works ok, but when I try to do it with code it retur...
more »

2017-03-21 23:03 (2) Answers

Range versus Range Cells using Index Match in VBA

I'm struggling to use the Range Cells method with Index Match in VBA. Using standard ranges works fine, but I'm having no luck with Range Cells. I must be failing to grasp something fundamental about Index Match. I have commented out the lines of cod...
more »

2017-03-21 21:03 (2) Answers

excel macro to cycle through filtering options

In excel File A, Col A i have family type for a parts list. 0.5V, 2V, 5V,10V,12V, etc in Col B thru K I have some part data dimensions and things like that. I was looking for a way to have a macro run a filter by the values in Col A, then run other c...
more »

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

VBA for loop (text only) - Beginner VBA

Dim i As Integer i = 1 Do While Cells(i, 1).Value <> "" Cells(i, 2).Value = Cells(i, 1).Value + 1 i = i + 1 Loop I am able to loop with numbers, but when I insert text and combined with another cell. The Do While does not loop thro...
more »

2017-03-21 14:03 (2) Answers

Extract phone numbers from comments

I have column with comments in it (more then 5000 cases). Those comments have text, numbers, date, everything. I need to get phone number out of those comments. Phone numbers are in random places for every comment, so LEFT,MID or RIGHT will not w...
more »

2017-03-21 13:03 (5) Answers

skip empty cells in loop

I have the below macro that should highlight cells in sheet2 different from cells in sheet1. It's working well but I have a problem with it highlighting blank cell: Private Sub Compare() Dim shtARng As Range, cell As Range With Worksheets("Sheet1"...
more »

2017-03-21 11:03 (2) Answers

dynamic selection for linear interpolation

I have a function, which i called InterpolLinear Function InterpolLinear(x, xvalues, yvalues) x1 = Application.WorksheetFunction.Index(xvalues, Application.WorksheetFunction.Match(x, xvalues, 1)) x2 = Application.WorksheetFunction.Index(xv...
more »

2017-03-21 11:03 (1) Answers

BeforeClose will not close my Excel-Sheet VBA

So I have been trying to put together a little Excel sheet, that has an entry Log in it. So whenever the sheet is closed, Name, Date and Time are added. So basically I have three macro running, I will only mention two. The main macro will ask if I w...
more »

2017-03-21 09:03 (1) Answers