Visual Basic for Applications; a subset of Visual Basic used in all Microsoft Office applications. Consider using this tag together with the tag for the specific application in question.

learn more… | top users | synonyms

0
votes
1answer
138 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
779 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 ...
1
vote
1answer
2k 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 ...
0
votes
1answer
587 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 ...
3
votes
1answer
1k 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
601 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
30 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
322 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
96 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
1answer
498 views

How to use for-loop in an macro of excel

I am completely new to Excel, but I want to make a macro where I can fill in two columns, and the start and end number of the rows, and it will do like this: =(A1*B1+A2*B2+A3*B3...)/((SUM of column B)...
4
votes
1answer
4k views

Copy data from multiple MS Word files to Excel using 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
1answer
224 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 ...
0
votes
1answer
184 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
1answer
1k 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 ...
0
votes
0answers
161 views

Changing the page number in Excel each time I print

I want to add an additional input box for range printing. I changed the code from this post to include another input box to determine the number range and to printpreview instead of printing if ...
3
votes
2answers
5k 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
333 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
0answers
656 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
1answer
76 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 ...
1
vote
1answer
397 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. =IF(AND(ROUND($GX19-...
0
votes
2answers
79 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
1k 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
31 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
351 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
2answers
535 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
2answers
812 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
2k 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
230 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
5k 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
283 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
9k 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
2k 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
1answer
2k 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
469 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
161 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 ...
0
votes
1answer
1k views

VBA - Instead of ActiveExplorer.Selection to set folder, explicitly set folder path

Sub MoveItems() Dim Messages As Selection Dim Msg As MailItem Dim NS As NameSpace Set NS = Application.GetNamespace("MAPI") Set Messages = ActiveExplorer.Selection If ...
0
votes
1answer
5k views

How to delete specific columns from all excel workbooks in a particular folder

I have a folder in which I have about 30 excel files. In each of these files, I need to delete about 20 specific columns. Here are some details: I am using Excel 2013 The columns are in the first ...
0
votes
1answer
666 views

VBA Solution to VLOOKUP with Hyperlinks

I am looking for some help with a VBA solution for preserving hyperlinks when using VLOOKUP on Excel (2010). I have a load of data on Sheet 1 for internal use only, and a cut-down version of this ...
1
vote
1answer
136 views

Is it possible to change or modify built-in VBA editor in Excel for Mac 2011

I am using the built-in VBA editor in Excel 2011 for Mac, but the built-in editor doesn't respond well to my scrolling gestures. I'm having too much trouble writing/finding code. Is it possible to ...
1
vote
1answer
1k views

Hide/Unhide rows based on more than one cell value

Please help me I am using the following code to hide rows if cell values are 0: Private Sub Worksheet_Calculate() Dim LastRow As Long, c As Range Application.EnableEvents = False LastRow = Cells(...
0
votes
1answer
351 views

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

I would appreciate help on the above-mentioned topic. I am unfamiliar with Visual Basic for Excel, so will need step-by-step guidance (if solution is via Visual Basic). For example :- Row 1, Sheet A: ...
1
vote
2answers
504 views

Word - Extract picture 'alt text - description'

I have a word document with 500+ embedded images. For each image in the document, I want to get the 'Description' from the 'Alt text' section of the image (when you right click on an image>properties>...
4
votes
1answer
12k views

Add/Subtract button Excel VBA

Here is an example of my project in this picture I like collecting, so I am making an inventory sheet in Excel. I want to make a way that I can click a button and it affects the next, or previous ...
1
vote
0answers
131 views

MS Word 2010 macro to renumber pages within the footer of all sections.

My problems is that I also have a divider page which originally I provided -1 in the page field to get the appropriate count. Could you please advise how I can manipulate the macro to take this back ...
1
vote
1answer
415 views

Renaming/moving attachments using VB - Filenameincrement

This script may seem familiar because I took this copy from Superuser (or Stackoverflow) and changed it to suit my needs. The script moves Outlook items around, copies the attachment to a folder and ...
5
votes
2answers
79k views

Searching for a value in Excel, returning yes or no

I have one workbook, with two separate worksheets. I want to know if the values that appear in worksheet B also appear in worksheet A, if so, I want to return a "YES". If not, I want to return a "NO". ...
1
vote
3answers
395 views

Trouble using Excel OFFSET function

I have an Excel workbook with numerous sheets entitled "Week1", "Week2", "Week3" ... "Week7". Each week, I input the customers IDs of people buying my product in column C, and -- as I am interested ...
0
votes
1answer
902 views

VBA EXCEL: find method not working when looping through each cell in selection

I'm trying create a macro that, after a range selection, will tell me how many 20ft or 40ft containers where found in the sample. The macro basically looks for the string "1x20" or "1x40" and when ...
0
votes
2answers
544 views

Split single column data into multiple columns based on leap year in Excel 2013

I have about 100 files of MS Excel which consist of weather data. I need the data on yearly basis but the file has a single column with data of about 140 years and manually copy-paste is very time ...
1
vote
2answers
2k views

Can the data validation list width be controlled in Excel 2007 and greater?

In Excel 2007, I can add data validation to a cell, and supply a list of allowed values. However, experimentation suggests that the data validation drop-down list will never display at a smaller ...