VBA stands for Visual Basic for Applications, a subset of Visual Basic used in all Microsoft Office Applications. Consider tagging your question with the application as well as [VBA]

learn more… | top users | synonyms

0
votes
0answers
38 views

Excel add picture from another worksheet in comment box

I have index worksheet that is used as a table of contents that link to other sheets. I would like to show a preview of the pictures on the other sheets. I learned that the best way to do it is insert ...
0
votes
1answer
131 views

Excel vba code for adding a value to existing cell of sheet

i have this code to add value of a cell to existing value of other cell which is below Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not (Intersect(Target, Range("E3")) Is Nothing) ...
0
votes
2answers
75 views

Excel 2010 formula, How do I write this formula? (VBA)

I need a bit of help from the more experienced Excel VBA users. Basically I have 2 groups of 3 cells (6 cells total) If one group of 3 cells is filled in it needs to accept it and not return a ...
1
vote
1answer
74 views

Excel 2007 VBA code to aggregate data based on conditions and calculate a weighted average

I am importing data from a trading system that has buy and sell orders for multiple securities(stocks). I need to aggregate the same security buy orders and the same security sell orders, creating a ...
0
votes
1answer
774 views

Split Excel worksheet into multiple worksheets based on a column with VBA

Question is simple and may be repetitive. I have an Excel workbook which contains around 50 columns I have a criteria column for splitting this workbook into mulitple workbooks The approach is as ...
0
votes
1answer
36 views

How to call a namer range using a variable to define the name

According the documentation, any quoted text names can be defined by a variable If I define Set xlsDataSource = Application.Workbooks("New_TOR_V1.xlsm").Names("MyRange").RefersToRange it works as ...
1
vote
2answers
7 views

Workbook doesn't find macro

I created a macro in a workbook which is being used by several persons on their own computers. For some of them, it seems to work fine, but for other a message appears that it can't find the macro on ...
0
votes
1answer
85 views

VBA string search within files in directory not working in Excel 2007

I'm trying to look for a string within a folder containing several files. Once the string is found it should select and copy a value in an adjacent cell 5 columns to the right(Offset(0,5)), then paste ...
0
votes
1answer
38 views

Outlook 2010 Run Script via Rules

I have the following subroutine in ThisOutlookSession: Sub receiveMtgRequest(Item As Outlook.MailItem) MsgBox "You have received a meeting request: " & Item.Subject End Sub I have set it to run ...
0
votes
0answers
44 views

Outlook VBA not recognising Inbox subfolder

There are 3 email addresses controlled by Outlook. When an email arrives to a specific email account, a specific word in the subject line directs the email to one of 2 sub-folders: PHY2048 or PHY2049. ...
0
votes
1answer
39 views

How to merge rows with same Name merging data of each ?related column

I need to merge rows with same Name preserving data of each column. For example, if we have two rows with the name "Mr Bean" on the first column "Name" then merge data of each column related to rows ...
0
votes
1answer
121 views

How to combine values from multiple rows into a single row using module?

I'm looking to combine multiple rows into a single row based on a value in the code column.. I've noticed other questions on here similiar to my question but I cannot seem to extend the range.. Code ...
4
votes
1answer
108 views

Using English macros in French version Excel

I am currently in France and am using a computer on which all Office programs are in French. I need to use a Macro which has been written in English VBA, but it fails. I assume the issue a language ...
0
votes
0answers
145 views

Macro to Import CSV files into Excel

I have a bunch of CSV files in a folder. I'd like to import each file into Excel using the 'Import from Text' tool by typing the name of the file into a cell. I then need to format all of the data ...
0
votes
1answer
79 views

How to format cells between two dates with a colour based on a value in vba?

(apologies if this question is difficult to understand, i'm unable to post an image) I've tried finding a solution for this online but haven't had much luck. Ideally, I want to use conditional ...
0
votes
0answers
55 views

I'm looking to create some VBA code to search for other instances of certain string, move original instance above found

Please excuse me if I'm posting incorrectly in any way- this is my first go round on superuser. I'm looking to create a fairly basic VBA macro to automate a process in excel I'll otherwise have to ...
2
votes
2answers
66 views

VBA Syntactic Sugar

I use VBA in my work every day, but I didn't know about Range syntactic sugar. I just knew last month when I saw MSDN Range page. I tried to find an article with this features, but I didn’t find any. ...
0
votes
0answers
37 views

MS Access Personal Macro Workbook

In MS Excel I have a personal macro workbook that is with me no matter what excel file I open. Is there a similar solution available for MS Access? The reason I am working on this is that i want to ...
0
votes
0answers
75 views

How can I create a persistent data connection from MS Project 2013 to Excel 2013?

I'm trying to get dates from an MS Project file to come across to a separate Excel file which I'm using to run conditional formulae on to handle the project status matrix. The catch is that I need ...
2
votes
2answers
68 views

VBA Excel 2007 help to speed up code to hide rows

I am trying to write a VBA code that automatically hides rows if a value in the row is equal to "". My range of values is A37:A400. Because my range is so big my previous VbA is to slow and looks one ...
0
votes
1answer
36 views

Changing the color of a shape every 5 seconds in excel using VBA

Hello I am looking for the VBA code to change the color of a shape in Excel using VBA every 5 seconds from when I click a button. the name of my shape is "Rectangle 1".
0
votes
1answer
47 views

Updating another Excel spreadsheet from current spreadsheet

I used the VBA code in "How do you write an Excel formula that will paste a specific value in a different cell?" posted here in May 2013 and it works well to populate/fill another cell in the same ...
0
votes
0answers
78 views

how to convert data in table format to pivot format

I would need help in converting table which is in table format to a pivot format. Below is the sample data which i have: ![Input File][1] Product Currency Value US UK Japan Ind ...
1
vote
2answers
25 views

Cleverly locked myself out of excel's vba editor in my worksheet

I'm working in Microsoft Excel 2010 I was creating a worksheet that is supposed to be hardt to screw with for the person other than me who used it. To modify data in the sheet I utilized a userform ...
3
votes
2answers
46 views

Check value is numeric and no more than n digits

I'm trying to add some validation to a VBA sub and I need to ensure the user enters a number and that it is no longer than the set limit, I'm pulling this in using a function as it varies depending on ...
0
votes
0answers
41 views

Import CSV file to XLS workbook using VB Macro

I have an excel workbook, with one main sheet called "BASE". Here there is one column where values are filled. There are two types of these values: 1) Scalar value and can be entered directly in this ...
1
vote
2answers
32 views

Copy Columns until a boundary

Am trying tell VBA to copy all the cells from Column "Data_FirstCoumn" until "Data_Boundary" Column. However VBA keeps throwing up an error stating that "AutoFill method of Range class failed". ...
1
vote
1answer
44 views

How to create multiple rows combining data sets

I have three tables and i need an out put which has data from two tables, i would like to create the same using macro. Table A A B C D Table B Apple Orange Pears Table C Americas Asia Europe ...
0
votes
1answer
48 views

Insert columns, within a range, based on cell reference

So am trying to tell VBA to insert a certain number of columns between two other columsn based on a cell reference. I've managed to get excel to insert columns within my range: Sub INSERT() ...
0
votes
1answer
43 views

compare and update spreadsheets

Please I need some help with excel spreadsheet here. I have two worksheets, one holding the old records and the other holding the current record. What I wish to do is to develop a vba code associated ...
1
vote
2answers
35 views

How do I split a directory when a field changes in Word 2010?

I'm creating a directory mail merge in Word 2010 using an xlsx file as the record source. One of my fields is "Manager". Most of the fields will be different on every line, but Manager will be ...
2
votes
2answers
31 views

Insert specified number of columns between two named columns

I am trying to use VBA to insert a set number of columns between two preexisting and defined ones. However, it keeps inserting the new columns to the left of the range. I want to insert the columns ...
2
votes
1answer
93 views

Using VBA to name a cell name box in Excel

I would like to iterate through rows in a worksheet and assign the name boxes of one column (the E column) to the value of that respective row in another column (the B column). I would like to ...
1
vote
1answer
112 views

Excel VBA code Private Sub Worksheet Change Power function not working

I'm making a worksheet where the wind speed defines the potential energy of the location. This value is the basis of a few sheets in the same Excel file. I'm trying to write a code that where I10 is ...
0
votes
3answers
55 views

Combine rows in Excel

I have data in column 1 and data in column 2 as follows: 1234 eggs 1234 bacon 1234 toast 4321 Orange Juice I want it to appear as follows: 1234 eggs-bacon-toast 4321 ...
0
votes
1answer
61 views

Transpose data in columns to rows downwards

I am working on a Excel VBA Project. I have data in an excel file as such (each alphabet in each cell). I have many lines as such and each line will definitely have data in the first 6 cells, with ...
2
votes
2answers
150 views

Excel VBA Replace Character

I tried looking around for this particular problem, but couldn't find it. I am trying to replace an assortment of characters in a string. I tried looping through the characters using their character ...
0
votes
1answer
47 views

Generate ordered numeric list in Excel based on cell value

I'm not sure if this is possible, but I would like to create an ordered numeric list automatically based on a cell value. For example, if I have a cell with a value of 100, I want excel to ...
2
votes
0answers
162 views

Splitting an excel 2010 spreadsheet into multiple workbook files based on column value

I find and clean a lot of contact data, sorted by country, which I am currently using excel to manage. Mainly because it is easier to clean and manipulate the data I find this way, and I can easily ...
0
votes
0answers
324 views

how to get encode type of text file using vba

I would like to check encode type of text file is UTF-8 without bom or SHIFT-JIS. Because I change to SHIFT-JIS if encode type is UTF-8 without bom. So I want to get encode type of text file. What is ...
0
votes
1answer
178 views

How to convert UTF-8 to SHIFT-JIS using vba

I am developing an application that reads from a text file and writes to a CSV file. Since characters in the text file are UTF-8, the CSV file also contain the same characters. Because of UTF-8, ...
0
votes
1answer
42 views

I'd like to make a line of code which prints a vlookup formula to the cells going down a column

This is the formula I'd like to print to each cell going down the column: =VLOOKUP(CONCATENATE(E2,C2), WORKABILITY_INDEX!$A$1:$B$82, 2, FALSE) I am using a statement like the one below: Last = ...
1
vote
1answer
84 views

Need a Excel script to identify email addresses that contain a different variation of the first name of the contact

I have an Excel spreadsheet with 50k+ rows of data, where we are trying to identify within the rows of data where the email address has no match of the first name, etc. We are basically trying to ...
-1
votes
1answer
77 views

How to generalize a macro to any row

The Excel macro below is written to function on a specific row (row 2) of Excel. I would like to be able to apply it to any row that I select rather than just to row 2. Does anyone know how to adapt ...
0
votes
1answer
72 views

How to one-click print in Access 2010

I want to create a button on a form in Access 2010 that, when clicked, prints the current record/view of a form. I have tried various VBA scripts. Some print all records, others print partial parts of ...
1
vote
1answer
143 views

Expand or minimize worksheet groups on Excel's tab bar

Is there a way to group worksheets in Excel 2010 so that not all tabs are immediately visible? Basically, so that they could be expanded and minimized as needed. I have a few Excel workbooks with ...
0
votes
0answers
228 views

Fill a web form with data from excel (macro)

I am new to VBA and I am struggling to find a solution for my problem. I have an excel database with UNs and PWs for a number of profiles. I also have an administrator UN and PW and each time I want ...
0
votes
2answers
457 views

Checkbox in dropdown list

I have a table in excel where I can select multiple items from a dropdown list in one cell. Now, using my macro I have to pick all of the options separately, and they are added to a cell one by one. ...
0
votes
0answers
151 views

VBA Macro to sort and apply conditional formating to a range of cells with dynamic number of rows

I have a range (the image below). Please note that: Range is generated by another application, so number of rows is ever changing, and is not formatted as an Excel 'table' The number of columns, ...
1
vote
1answer
161 views

How to check data exists or not in array and add items to array using VBA

I always write data 【AAA, BBB, CCC】into CSV file. I would like to also write other data (eg:DDD) if there is in text file. An array: arr = Array("AAA", "BBB", "CCC") Text File(Read): AAA BBB ...