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

-1
votes
0answers
4 views

Run-time error '13' : Type Mismatch

While writing a Macro for Concrete Column, I have encountered a "Run-time error '13' : Type Mismatch" Error Here is the code. Option Explicit Sub Pu() Dim D, b, fck, fy, Es As Double Dim xi As ...
1
vote
1answer
18 views

Execute SQL Query with VBA and fill sheet with data

Very new to any form of code. Attempting to run a script in VBA that will pull data from an access database using SQL and put it into an excel spreadsheet. Code is similar to below. Runs clean but I ...
0
votes
1answer
4 views

Formula to incorporate Highlighted text & Loop function

I'm trying to analyze over a 1000 line items, with different information in all columns ,although certain columns might have duplicate information. I can do conditional formatting and highlight the ...
0
votes
1answer
19 views

User Input to Select and Fill In value for Cells

I have this excel table: A2 to A11 are class names Class_1, Class_2,..., Class_10. B1 to K1 are student name 1,2,3,...,10 For each student in his class, I will need to fill out his grade I would ...
0
votes
1answer
10 views

merge two exel sheets and update duplicate value

I have two exel sheets and I need to merge this sheets but in sheets 1 i Have 800 records in sheet 2 i have 20 records and some of value from sheets 2 are duplicated in sheet 1. I wan to update ...
0
votes
1answer
24 views

Spreadsheet data checking columns

I am trying to separate datas from columns(A,B&C) based on datas from an index table at columns (E&F) I need to list only those data from columns A/B/C when column B data has no corresponding ...
2
votes
1answer
26 views

Adding attachment option to scheduled email vba script

I am learning VBA, but for the time being I am not that good and I found this macro: Scheduled and recurring email in Outlook? It sends an email thanks to a scheduled appointment set in the ...
-1
votes
1answer
26 views

Automation Error Catastrophic Failure

I am trying to use excel VBA to copy some charts to Powerpoint slides using the below codes, but it shows error "Automation Error Catastrophic Failure". I can not figure out what is the problem. I am ...
1
vote
1answer
21 views

Excel automaticly adding an extra row which already contain formulas for the inputed number of years

I am looking to build a model, I would like is have an input page where you input the range of years you would like to cover. Depending on the inputted number of years, I want a table (on a different ...
0
votes
1answer
32 views

How to automatically replace Excel formula with value when date/time condition is met

I need to record results of a constantly changing cell based on external criteria. Cell B3's value is changing, and I need to record the value of B3 at specific points in time. Cell D2 contains the ...
0
votes
1answer
17 views

Excel: Referencing a named range inside a formula

I have two tables, the first table has 6 column and each column has a defined range name as follows: Col 1: Broker_Name Col 2: Broker_Market Col 3: Client_ID Col 4: Client_Location Col 5: ...
0
votes
1answer
34 views

How to add custom styles to navigation pane or change them with VBA

I have a Word2010 document that was created by a tool from Axure. Each heading is formated with a custom style ("AxureHeading1", "AxureHeading2", "AxureHeading3"). I was able to create a table of ...
0
votes
1answer
14 views

Excel - import data from cell automatically when a new tab is created

I am working on a spreadsheet summarizing data from standard templates inserted in a joint Excel file as separate tabs. Is it possible to automatically import data from a specified cell into a ...
2
votes
2answers
26 views

I would like to copy data from 1 row to another in Excel

I am trying to solve the following issue in excel: I am working in two sheets, Sheet 1 and Sheet 2. There is a column of data in sheet 1 (say from A5 to A20). I need every row from that column to be ...
0
votes
1answer
29 views

Using VBA to calculate unique random numbers in “i” number of rows

I am currently working on a pet project of mine. I am currently making a combat calculator for a gaming group I DM. Essentially, I have a table with the monsters and their stats, and a cell with the ...
1
vote
3answers
43 views

Excel VBA - adding an element to the end of an array

Simpel Question I like to add a value to the end of an array and increase it automatically? I was not able to find such a simple example Public Function toArray(range As range) Dim arr() As Variant ...
0
votes
0answers
27 views

Set default outlook send address based on TO field

Is there a way to have outlook pick the right email address based on the TO or CC fields? For example, if I am sending an email to domain1.com, use account1@domain2.com, else ... I am open to ...
1
vote
0answers
14 views

Adding numbers based on their relative position in a worksheet

I have nearly 10,000 numbers arranged on an excel worksheet to form the map of USA. Now I want to separately add the numbers based on below mentioned four criteria: 1.0 Corner cells i.e cells flanked ...
0
votes
1answer
23 views

Timestamp in Excel…not working?

I know this question has been asked numerous times, and I have truly searched and attempted to work it out with the given solutions to no avail. Maybe I'm doing something wrong, but I don't know much ...
0
votes
0answers
35 views

comparing two columns for matches then return values meeting certain conditions

I have the following: column D ( 300 values representing the average of three cells, A1:A300 & B1:B300 & C1:C300) column H ( 50 values ) column E & column F & Column G; they are to ...
0
votes
1answer
44 views

How to bypass the VBA project password from Excel

I need help with password retrieval or bypassing the password on a project that was done at work. The author has used MS Excel to do the project, and it's in the client's server. The server that we ...
0
votes
1answer
36 views

Excel Pivot Table - How to preserve Filter and Sorting when Data get refreshed

I have a pivot table (Excel 2010). Every Time when I update the data and make a refresh, the sorting and filters of the Pivot Table get lost repsectively I need to explicitely to modify the filter ...
-2
votes
1answer
25 views

VBA dates filter [closed]

easiest way to explain this is to use a example. I have two dates(f.e.) "2014-08-08T8:11:31" and "2014-08-11T13:53:29". I need to gave them proper form(date),exclude weekend(Saturday, Sunday ) and ...
0
votes
3answers
139 views

Run excel macros (vba) from vbscript file

I have a vbs file that pulls information from my database and exports the data to an Excel file (C:\file.csv). Once this is done, I run a series of macros (vba) to format this data. These macros are ...
0
votes
1answer
10 views

extracting labels of data in a pivot table

When I move the mouse pointer over data in a pivot table it displays what are the row and column labels (names of pivot items). How can I extract them so I can later use them in a code (when I want ...
-2
votes
0answers
42 views

VB macro for excel

Coding a lil' macro so it pulls data from one book and paste's it into another book and I'm a little stuck. It copies data but only from the book I created the macro/button in, and not any other book. ...
1
vote
2answers
31 views

Changing DateTime format in multiple CSV files

I've got multiple csv files with this structure: text, text, 01/27/2001 01:00:00 PM I need to update ALL csv files with this datetime format: text, text, 27-Jan-2001 13:00:00 Is there a known ...
0
votes
1answer
33 views

Excel - How can I collapse data, eliminating blank rows?

I have a 3 column, 20 row table. (A1:C20) The 3 columns are each 1 digit of a 3 digit number. Some of the rows have 3 digits, some are blank. I need a way to return all the non-blank rows of 3 ...
1
vote
0answers
30 views

Excel VBA - User Defined Function to turn string into formula

I'm looking for something similar to the solution posted here: Excel function that evaluates a string as if it were a formula? Problem is this does not seem to work with a function in there. This ...
-3
votes
0answers
22 views

Automatically move Outlook message to the specific folder when click on reply to all

I want if i recieved any outlook message from aspecific person. Firstly It comes directly in my inbox folder. But when i reply to the same message, then a script runs save that particular old message ...
0
votes
0answers
21 views

Keep header text in Excel, but change font

I've seen several examples for changing the header font in Excel; however none of them just change the font. They seem to always incorporate static text or a cell reference. How do I change just the ...
0
votes
0answers
23 views

excel - ask for input to be used as new cell values

I use excel 2007 and I want to create the following function: At first I need to add a vba function button that prompts the user to add four different values, e.g. a name, a number, a date and an ...
0
votes
2answers
39 views

How can I trigger an Excel macro by hovering a mouse over a cell?

I have not been able to figure out how to run an Excel macro by moving my mouse over one or more cells in my spreadsheet.
0
votes
1answer
23 views

How to Run macro in excel instance “2” from excel instance “1”

Lets say i have already opened Workbook 1 in Excel instance 1 and Workbook 2 in excel instance 2 And i have macro called "AAA" in instance 1 and "ASD" in instance 2 i want to call "ASD" in instance 2 ...
5
votes
2answers
85 views

How do I add VBA in MS Office?

I've seen posts showing answers which use VBA (Visual Basic for Applications) code/macros, however, I've also noted additional comments afterwards about how to use the VBA (how to implement it). I'm ...
0
votes
3answers
109 views

Excel formula to compare single value in one cell with multiple values in other cell

I have a value in Column A, which I want to compare with multiple values in column B, and depending on that value, put the answer in column C. For example, using the table below, it searching in ...
0
votes
1answer
26 views

Excel macro to save workbook on another session of excel

Im trying to make a macro in one session of excel that saves a particular workbook in another session of excel. Lets say i have Workbook1 and Workbook2 and i have opened them in different excel ...
0
votes
1answer
20 views

Excel: Find a specific cell and paste the value from a control cell into it

I have two columns one containing the room number, e.g. B-CL102, the other containing a varying integer. I want to enter a different, manually determined, integer in a third column. Whether by macro ...
1
vote
1answer
31 views

VBA + Polymorphism: Override worksheet functions from 3rd party

my company makes extensive use of a data provider using a (closed source) VBA plugin. In principal, every query follows follows a certain structure: Fill one cell with a formula, where arguments to ...
0
votes
1answer
39 views

Excel VBA Insert Character Between Number and Letter

I would like some VBA code that would allow me to detect if a string contains any instances of a number followed by a letter and then insert a new character between them. For example: User enters the ...
3
votes
2answers
126 views

Creating folders and sub-folders with a VBA macro

I'm looking to use a spreadsheet I've created to generate folders and sub-folders based on what is in each column. The first column is the top level, the second column the next level down ...
0
votes
1answer
49 views

Use VBA in windows to run a python method with arguments in Linux?

I'm using MS Access on a Windows 7 PC as the front end of a MySQL database back end that is stored on a SUSE Linux Enterprise server. Python is installed on the Linux server. The python script I want ...
1
vote
0answers
38 views

run-time error 1004 Application Defined or object-define error

I have this macro that I wrote: Dim lastColumn As Long lastColumns = wkbWorkbook2.Worksheets(2).Cells(1, Columns.Count).End(xlToLeft).Column 'this is the highlighted part in debug SourceRange.Copy ...
0
votes
0answers
19 views

How to keep formulas in the destination cell

I'm using vba to copy data from several workbooks and put them together in one sheet. I'd like to know how to paste the new info maintaining the format and formulas in the destination cell. The copy ...
0
votes
1answer
26 views

Get data from another Excel file

I have an Excel spreadsheet that contains a list of usernames Each user will have the following code. I just need to find a way to substitute First.Last with the names in the Excel spreadsheet. There ...
-1
votes
1answer
25 views

Excel: Averaging Sensor Data by Time Stamp

I have a device that collects temperature measurements from several sensors at discreet time intervals. This data is dumped into a .csv file with each row formatted as: [time] [sensor name] ...
1
vote
0answers
46 views

Windows (partially) claims I have a private key for a foreign certificate

We have a MS Word document template with vba code produced and signed by an external firm. When I view the details of the signing certificate from within Word vba developer tools, it shows up with ...
0
votes
0answers
18 views

Opening Numerous Closed Workbooks into One Workbook with multiple tabs/worksheets for each closed worksheet

I have a folder with 20 worksheets each worksheet conatins a scorecards which is (protected/ no password) and not in your typical table format. I want to have a macro to open all 20 of these ...
0
votes
1answer
35 views

Insert new rows and autofill with formula

I am trying to insert new rows if a particular condition is met. I want to drag the formula from the last row to the inserted row, but I am getting an error doing so. Below is my code: For i = 1 ...
-2
votes
1answer
34 views

sum the values in a column and add the sum to the filename of a workbook

Hello I have been able to create new worksheets based on unique values in a column. In addition to this, i want to sum up the values in a column and include this sum in the filename of each ...