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
1answer
14 views

Error outputting a string to cell

I am using a vba macro to automate part of an excel spreadsheet. The following line keeps giving me a runtime error 1004# application or object defined error Sheets("Material").Last.Offset(0, ...
0
votes
0answers
14 views

How can a Macro sort dates from oldest to newest?

I'm doing account statements in a bank and I need to be able to make them fast, so I am using macros for making this process. However, there is a step that I always have to do that a macro won't let ...
0
votes
2answers
24 views

VBA Excel: How to assign .txt file content to a string type variable?

I made a little sub in excel that sends an email according to the parameters you enter: Sub Mail_LSP(mailsubject As String, consignee As String, coalcopy As String, mailbody As String) Dim mlook As ...
1
vote
0answers
10 views

Why doesn´t my Outlook rule work more then once?

I´ve recently migrated my email to an exchangeserver, with my previous email set as a forward to my current one. I´m using outlook 2010 and Samsung galaxy s5. First problem at hand: Some E-mails ...
0
votes
1answer
13 views

Deleting rows that contain a keyword in the column

I have an excel file that has a id as one of the columns, each id has multiple entries and follow a set of survey questions. I need to delete all of the rows that have that keyword (which is in a ...
0
votes
2answers
39 views

Adding together values from multiple spreadsheets (VBA)

In my Excel workbook, I have three separate spreadsheets. The spreadsheets are identical in format and represent count values for different categories (passenger cars, trucks, etc.). I need to combine ...
0
votes
0answers
13 views

Replace multiple words in Excel sheet

Sub xLator2() Dim s1 As Worksheet, s2 As Worksheet Dim N As Long, i As Long Dim from(), too() Set s1 = Sheets("Sheet1") ' contains the data Set s2 = Sheets("Sheet2") ' contains the translation ...
1
vote
1answer
41 views

Find and replace multiple words in a column in Excel 2007

Sub xLator2() Dim s1 As Worksheet, s2 As Worksheet Dim N As Long, i As Long Dim from(), too() Set s1 = Sheets("Sheet1") ' contains the data Set s2 = Sheets("Sheet2") ' contains the translation ...
-2
votes
0answers
17 views

VBA Code to Connect Database and execute a stored procedure through a click of button in excel 2013 [closed]

I am new to VBA. Can anyone please help me to write VBA code that should connect to a SQL server database and execute a stored procedure through a click of button in Excel 2013. Details below: ...
0
votes
1answer
24 views

Excel: portable formula to reference data on previous (relative) worksheet

I need to create a fairly simple Excel spreadsheet (workbook). I need 12 sheets (tabs), one for each month. Each sheet references cells in the previous sheet. For example, the "May" sheet is ...
2
votes
1answer
34 views

Replace cell references with values without F9 using macro

This is an Excel macro question. Given a series of formulas such as the following: = A1 + A2 = B2 + B2 etc., ... I would like to replace each of these cell references with the values without ...
0
votes
1answer
36 views

Hide columns based on content (sum of rows)

I'm trying to hide columns based on the sum of selected rows (i.e., cells) in those columns. For example - if the sum of E9:E12 is 0, then hide column E. Additionally, and probably a little harder - ...
0
votes
1answer
9 views

RE: displaying max of direct data input or cell value from formula

With reference to : Excel - how to either have direct data input or cell value from formula I would like to inquire on a related issue. How would i edit my VBA formula if i would like to compare the ...
0
votes
1answer
18 views

Disable or delete right click menus VBA

Whenever I right click on an excel sheet two menus come up: one with cut, copy, paste, etc. and one with font size, bold, italic etc. I can customize the first one to have whatever command I want. ...
0
votes
0answers
12 views

Creating an Excel Search Box which Unhides a Row

I've never done VBA before and I'm pretty sure that's the only way to achieve what I need. I have a master password list which I don't want people to see when they are looking at my computer. ...
0
votes
0answers
33 views

Forfiles SubFolders

I am hoping I can get some help here. I saw a another post similar to my problem and I figured I would give it a try. I have a Forefiles code running in Excel using VBA. The code works great on local ...
2
votes
0answers
36 views

copy data from multiple word files to excel with vba

I know this question was already asked (Copying data from multiple word docs into one excel sheet) the thing is I can't use the answer. I'm fresh to vba, but I thought I can handle it. I was wrong. I ...
0
votes
0answers
24 views

VBA Code to update data in closed excel files within a folder by clicking a button

I have a code which works really well that updates values of closed excel files in a workbook. What I want to do is alter the code so I can create a on my worksheet where I can make y changes I ...
0
votes
1answer
9 views

Filtering out (blank) within a PivotFiled from all pivottables in a workbook that have the same pivotfields

I have a bunch (14) of pivottables in two worksheets (7 in each worksheet). I have a refresh button on the sheet that refreshes all pivottables using the following code: Sub Refresh_Pivots() Dim pt ...
-1
votes
0answers
16 views

Excel or R: Make 1 file for each line of a table, preserving the headers

I have 200 lines in an excel table that I'd like to split into 200 files (csv), with the headers maintained in each file. Is there a way I can do this using VBA in excel, or even R? Many thanks
0
votes
1answer
44 views

Expanding a cell formula resolving all its references (precedents)

In Excel I have a cell containing a formula referencing other cells, which reference other cells and so on... forming a large tree of references. I'd like to substitute recursively all the occurrences ...
0
votes
0answers
4 views

How to paste clipboard text into AlternativeText of an image - Winword 2010

Using VBA, in Winword 2010; how can you paste the text contained in the Clipboard into the AlternativeText of the current selected image within a word document? Below is the code I've done, to ...
1
vote
0answers
11 views

Convert HTML to Word and embed file hyperlinks as attachments.

I have some HTML files that I'm opening with Word and saving as docx files. I have some macros I run to break the links on the graphics so that they get embedded in the doc file, but I haven't figured ...
0
votes
1answer
19 views

Excel 2007 VBA Export range as jpg file is trucating picture

I have a workbook with many different ranges of data with 77 lines or more. I need to copy them and save as JPG files, which will be used by other application. Below is the example of code that I'm ...
-1
votes
0answers
15 views

Add-in Not working [closed]

I got this code from google and am trying to make it into an add-in. It currently wont work as any time I run it on another xlsm file I get the message. Cannot run the macro "MyGreatMacro". The Macro ...
3
votes
0answers
43 views

show more than 8 items in the Data Validation drop down list in Excel

I have added a simple data validation to a cell but it only displays 8 items in the dropdown. Excluding the combobox solution and probably involving some WinAPI is there a way to make the drop ...
0
votes
1answer
40 views

VBA Lookup by Multiple Criteria - Then Copy & Paste

Currently I have a 2 way database with 10+ fields and 1,000+ rows. Some fields are customer name, car model, year of model, price, date of purchase. I would like to lookup rows of data by multiple ...
1
vote
2answers
31 views

Excel 2010: Calculate full months between dates

I have dates in two columns and I would need to calculate amount of full months between two dates. I export the spreadsheet from SAP ERP in .xls format but opening with Excel 2010. DATEDIF function ...
1
vote
0answers
33 views

Transferring Data Between Workbooks Based on a Value in a Specific Cell

I have created a form in Excel that moves information entered in the form to the adjacent sheet in the same workbook as well as my agents workbook at a different file path. That piece of the puzzle is ...
0
votes
0answers
25 views

VBA Excel: Macro working well, add-in does half of the job

I created a macro that: 1.takes the value in cell "D11" then 2.trims the value acording to some criteria, then 3.opens another workbook ans searches the trimmed value then 4.copies some info to ...
0
votes
0answers
16 views

Displaying images from database in a pivot table

I've got a table with sales data on MySql server. I can connect to it from Excel and generate a pivot table just fine. One of the fields in the table contains URL to an image of a product. Is there a ...
0
votes
1answer
43 views

Obtaining Frequency of A Number for Each Sub-Heading

I have two columns, one with people and times associated with those people, and one filled with 0s and 1s. For any given person there is some associated combination of 0s and 1s. We can determine ...
0
votes
0answers
32 views

Automation of solver in Excel by VBA macro code

I'm solving a 3rd degree polynomial equation, e.g., -0.003x3 +0.195x2 -1.087x -180 = 0 in Excel. I can do this by SOLVER of Excel and can find the value of x. The problem is the constant term ...
0
votes
0answers
47 views

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

I'm rather new to VBA and I've been working with the code generously displayed and explained by Nixda: Split Excel Worksheet... My only challenge is I've been trying desperately to find a way to ...
0
votes
1answer
30 views

Convert formulas in table to structural references

I have converted my range in excel 2010 into a table. However, the formulas which were before like that(see below) stayed the same and do not convert into structural references. ...
0
votes
2answers
21 views

Showing name of row instead of excel cell name

I am having extremely long formulas over an extremely big sheet. At the moment I am tracking the formulas with the Formula Auditing Tool. However, my idea would be to just replace for example in a ...
-1
votes
1answer
58 views

Compare the value change of data in Excel between two similar sheets without VBA?

I need to match data in the column A's of two different sheets with similar data and then compare the values in column C. sheet 1 features data from this month, sheet 2 from last month. I have column ...
0
votes
0answers
10 views

Word crashes when printing with cursor in table

I've been doing some VBA in word to create reports and certifications. These docs include tables. I need to print my docs, but when I try, Word crashes. I find out that if the cursor is inside a ...
2
votes
2answers
73 views

How to Programmatically Split Data Using VBA Using Specific Logic

This is an addition to my previous post here. The code that was previously supplied to me worked like a charm, but I am having issues modifying it adding some additional logic. I am creating a macro ...
0
votes
1answer
43 views

Months and Date keep being switched around when running VBA

I have a column on my sheet, Column F which is full of dates. Now I need these dates to be in this format "dd,mm,yyyy" but sometimes they are in text form, us/armenian format in the original data. Why ...
1
vote
1answer
18 views

Clear contents from matched column of data in another sheet

I have a column of email addresses on sheet 2 col A (but I could put them on sheet 1 if it would make it easier / faster) that I want to remove from sheet 1 col D if matched (there may be 2 or more ...
0
votes
2answers
47 views

Excel concatenation of one column based on values in another

Similar to this: Excel - pivot values in one cell (as comma-separated value) Except it can be a VBA solution, and I do not have duplicates in Column A. Instead, there are blank rows below each value: ...
1
vote
1answer
76 views

Need to pull data from website after every 5 seconds using Vba [closed]

I need to pull data from www.dsebd.org after ever 5 seconds. this Vba code pull data but does not run automatically. Please help me. Sub ButtonCode() ' execute macros Call GetCotton ' ...
0
votes
1answer
30 views

Sort with a Macro

I have a spreadsheet with 8 columns of data. (Row 1 contains my headers). I am trying to record a macro that I do not have to edit afterwards. I press record macro, I highlight my data, I go to the ...
-1
votes
1answer
44 views

How to re-arrange Excel database from 1 long row, into 3 short rows of unequal lengths and automatically repeat the process?

This question is an extension/continuation of my previous question at How to re-arrange Excel database from 1 long row, into 3 short rows and automatically repeat the process? which was answered by ...
1
vote
1answer
92 views

How do I copy hyperlink only (and not text) to another cell? [duplicate]

I have a spreadsheet where column A displays names. There are a few hundred names and each has a different hyperlink (which links to that person's web page). I want to transfer those hyperlinks across ...
0
votes
1answer
35 views

Set default expand/colapse state on pivot tables

The Setup I have a pivot table in tabular form pulling data from an Analysis Services Cube. I want to calculate the number of days between two dates, but the setup will only allow me to pull in all ...
1
vote
0answers
52 views

Cannot use Date and Time Picker in Office 2013

Since few days I have tried to apply this ActiveX to my Excel 2013. I made small app for running reports in Excel and I need some way to pick start and end date. Easiest way to do it was Date And ...
0
votes
1answer
55 views

How to require a cell input if another cell has a value

I'm trying to edit the VBA for one of my workbooks so that If there is a value in column A, then a value for column C is required or else the file won't save, but i'm having some trouble with this. I ...
1
vote
0answers
30 views

Weird Excel 2010 VBA Window Behaviour

If I open Excel and then open the VBA window then close it, every time I RDP to my computer, the VBA window is open again, even if I closed it before disconnecting. The next time I am sat locally to ...