## 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 »

## "<Application-defined or object-defined error> Error 1004"

I have a simple for-next to fill some labels on a userform but can not figure out why a keep getting a " Error 1004" When I type the Contr.Caption the .Caption function is missing? Dim Control_Name As String Dim DSlot As Long Dim DLName As Long Dim ...
more »

## 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 »

## Make an Excel Macro that asks for a day and then insert it into the next open cell

I am trying to make an Excel Macro that asks for a day and then inserts it into the next open cell. here is the code I am trying to use. Sub Button7_Click() Dim AddName As String AddName = InputBox("Date: Month/Year", "Add Date", "01/00") ...
more »

## Open File From Outlook to Excel and Save as Different Format Depending on Sender

I use Stack Overflow a lot but this is my first post. I know just enough to be dangerous with VBA. I originally wrote this piece of code for Outlook - its original purpose was to rename any attachment file and save it in a specific directory (I s...
more »

## type mismatch probably due to array being missinterpreted

I get a type mismatch out of this code, if anyone can help that would be greatly appreciated. It probably has to do with where i used the split command.. i am trying to basically grab A2 and B2 then A3 and B3 and so on... to put it in another program...
more »

## (VBA) Exception handling for dashes (-), need to turn to 0's

Some of the values found in Sheet74 are dashes (-). If the values are dashes, they should be 0's. Sheet8.Range("O12").Value = Sheet74.Range("D3") Sheet8.Range("o13").Value = Sheet74.Range("D4") Sheet8.Range("o17").Value = Sheet74.Range(...
more »

## Print/Save IBM Notes Email as PDF before sending?

I am using the code below to create and send an email from excel using IBM Notes. I have tried and tried to get this email to save into a folder as a PDF or just print it so i can print it as a PDF. Whatever i try i cannot seem to get this to print...
more »

## 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 »

## How can I find all of the combinations appear in excel?

I have 5 coloumns, each of them contains a lot of different data. Here's an example: A B C D E F 1 0 1 1 0 1 2 1 0 0 1 2 1 2 0 1 2 1 1 0 1 1 0 1 ... I have to find all of these uniqe combinations. In the example the answer must be 3,...
more »

## 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 »

## Set Zoom in a PowerPoint document window without activation

I am creating a PPT from an Excel-VBA file and want to set the zoom of the ppt to 100%. How can I do this from the Excel file without activating the PowerPoint window? Or how can I even do it with activating the window? The following example code i...
more »

## 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 »

## Excel VBA: How to only allow macro to make cell input

I'm currently working on a worksheet, which should use different userforms to perform tasks and calculations. The userforms are called via buttons. So all the input by the user should be made via those userforms; the actual worksheet should contain...
more »

## 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 »

## Meeting invite from Excel macro - no body, set as appointment

I'm trying to create a vba macro which generates a meeting invite that uses variable data from a worksheet. My first problem is that it only opens up as an appointment, but not as a meeting with the invitees listed (however, if i click "Invite Atten...
more »

## Excel VBA: why is copy/paste overwriting other data, but only after 60,000 rows?

I've written code to loop through a folder of workbooks and extract certain columns from their worksheets then paste the data onto a single worksheet This code was working well until the 29th workbook, where the data that I wanted pasted at the bott...
more »

## Finding array data in worksheet values

I have a table sort of like this: Pendergrass (606)-663-4567 Rich (606)-667-4567 Scott (606)-987-4567 Dennis (606)-233-4567 David (606)-888-4567 Red (606)-567-4567 Wendy (606)-765-4567 Todd (606)-677-4567...
more »

## Removing leading and trailing semicolons from a text in a cell

Suppose in a cell sometime text looks like ;ABCD;EFGH ;;ABCD;EFGH; How to remove semicolon only from beginning and end. The outcome should be ABCD;EFGH ...
more »

I have an excel worksheet that has a column "A" with a string path in it like this: foo\bar foo\bar foo\bar foo\bar foo\bar foo\widget foo\widget foo\widget foo\zelda foo\zelda foo\zelda I need to add a header row before each change in the path so...
more »

## Excel VBA - Loop not adding autofilters to my worksheets

I have some code that (should) loop through all my worksheets and add an autofilter, however for some reason they're not showing up. When I turn on events, I can see that it is quickly being added then removed almost instantly. I'm assuming that this...
more »

## VBA: Cycle through files in a folder, and take information from all that contain a certain string

I've been trying to write a code for VBA that will cycle through a folder, given a user inputted folder path, and paste some information, like a range of cells, and the file name in my work book based on whether or not a filename contains a specific ...
more »

## VBA: Copy data from another workbook, based on cell value of current workbook

Currently I have a workbook that loops through workbooks in the same folder as it, end copies data from specific cells back to the master workbook. If I want to change to cells from where the code copies cells, I’ll have to change this value in the...
more »

## VBA Store Color Index in a Variable

My program is supposed to check the colour index of a cell and then based on its colour, it increases a counter. For some reason I don't seem to be able to store the colour index to a variable though. Here is the code: Dim orange As Integer, green ...
more »

## Sending a spreadsheet through email vba

Hey guys I have ran into a problem trying to send an email via excel. I am trying to send an email from excel which shows a timetable as shown. On Friday I was able to get the email to send but now it doesn't seem to be working. Maybe its just ta...
more »

## Opening a specific worksheet in a specific workbook

I have the following code: Dim conRow As Long Dim targetBook As Workbooks Dim targetSheet As Worksheet Dim targetRng As Range targetBook = Workbooks("C:\file\path\here\filename.xlsx") targetSheet = Worksheets("SheetName") targetRng = Range("$A:$A"...
more »

## Worksheet Change repeating steps

I have reworked this macro for two days in a load of different ways to try to prevent steps from repeating but the range G2 step seems to run 3 or 4 times and the range G3 2 or 3 times. Does anyone have any ideas?? Private Sub Worksheet_Change(ByVal...
more »

## SpecialCell(xlCellTypeLastCell) does not work in custom function in Excel

The custom function below entered in a cell with a reference to another cell does not work. I do not understand why. Does anybody know the answer? Public Function SpecialCellBroken(rng As Range) Debug.Print rng.Worksheet.Cells.Address Debug.Print rn...
more »

## VBA macro for Google search

I am trying to modify a VBA macro for Google search. I want the output in excel to be the number of results (hits on Google). I have tried to change the element within the macro to "resultStats" but I keep getting bugs when I am trying to run it. The...
more »

## How to detect if ctrl + enter in an Excel spreadsheet with VBA

My understanding is: Macro canNOT be activated while a cell is active for editing. I notice by hitting ctrl + enter, the cell is de-activate for editing but remain selected. I would like then to run some macro refer to this cell. Therefore, using V...
more »

## VBA : Change the style of text when sending a mail

I use Excel to send emails using text in a textbox as body. This works fine, except that when sending a mail, it only copies the text's font size, but not its color or style. I did lots of research, but didn't find any solution. Is there a code that ...
more »

## Excel VBA: Copy and paste duplicate values based on font format

I have an Excel format that looks like this: What I need is a VBA code in Excel that will read all the data in column A and look for any text in italic format then check if it has a duplicate data on the same column. If yes, that data will be writ...
more »

## Send CDO emails from any client/server with excel using VBA not working

I'm trying to set up an .xlsm workbook for someone so that they can just press a button and it will send emails out to different email addresses with specific data from the spreadsheet. I don't know what email client or what server they use so ideal...
more »

## Loop that returns to starting point for selecting Nth row

I want to select M companies from a sample of S companies and doing this starting from a random number selected between 1 and S and selecting every Nth company. To get the sample of M, I want the loop to come back to starting point for selecting th...
more »