Questions tagged [vba]

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. Good questions on VBA generally contain some code and asks for solution of specific issues. Questions asking for entire solutions (please give me the code / how to do this and this with VBA) are off topic and will be closed as too broad.

Filter by
Sorted by
Tagged with
6 votes
1 answer
895 views

VBA Debugging - step through main program, but run routines called from it?

Say I have a big primary routine, that does many things and calls various other programs. When debugging, I step through my main program with F8 so I can see line by line what's happening. However, ...
BruceWayne's user avatar
  • 2,654
6 votes
3 answers
27k views

Use a Trendline Formula to Get Values for Any Given X with Excel

Is there an easy way to apply the trend line formula from a chart to any given X value in Excel? For example, I want to get the Y value for a given X = $2,006.00. I've already taken the formula and ...
Kirk Ouimet's user avatar
  • 2,725
6 votes
1 answer
65k views

Inserting a (jpg) picture into a cell in Microsoft Excel 2007

Is it possible to insert a jpg image inside a cell, or do Excel cells only display alphanumeric characters (or references)?
robihot's user avatar
  • 121
6 votes
2 answers
8k views

Excel & VBA - Where is underlying code for functions?

I was wondering if there's anywhere in Excel, or online, that I can use to see how the Functions in Excel are working. The idea is that I'm starting to learn how to make UDFs, and do various things ...
BruceWayne's user avatar
  • 2,654
6 votes
3 answers
2k views

How to find and replace the character “*” in excel text values in cell, but NOT formulas

Very similar to this question: How to find and replace the character "*" in Excel But I need to leave formulas untouched. I've got about 50+ sheets that have two types of cells with "*" ...
StillLearning's user avatar
6 votes
5 answers
6k views

Bring back the object browser in Word 2013

In previous Word versions there was a very handy feature called "object browser" that allowed you to quickly navigate a document. Here is a very simple explanation of what it does: http://www.upstarts....
s_a's user avatar
  • 2,099
6 votes
2 answers
8k views

What would an Outlook 2007 macro to automate Paste Special - Unformatted Text look like?

I'd like to assign a macro in Outlook 2007 to a Toolbar button that would execute the equivalent of these clicks when there is formatted text in the Windows clipboard: Click the Paste icon by the ...
Gary Petersen's user avatar
6 votes
2 answers
10k 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 ...
user294589's user avatar
6 votes
1 answer
82k views

Find and replace multiple values within selected cells

I want to run a find and replace on multiple values within a range in excel with values from 2 columns: A with the original word; B with the translation. I already found the VBA code to get this ...
WouterB's user avatar
  • 185
6 votes
2 answers
8k views

Create new folder for new sender name and move message into new folder

Background I'd like to have Outlook 2010 automatically move e-mails into folders designated by the person's name. For example: Click Rules Click Manage Rules & Alerts Click New Rule Select "Move ...
Dave Jarvis's user avatar
  • 3,238
6 votes
3 answers
6k views

Excel: Update a value in a named range

I've got some cells in an Excel doc populated from a named range (data/validation/list source=MyNamedRange): Here, the A1:A3 range is named Foobar B5:B6 is under data validation with it's source set ...
Vinzz's user avatar
  • 162
6 votes
3 answers
8k views

Can I customise the new Timeline slicer in Excel 2013?

Excel 2013 introduces timeline slicers for the first time. These allow you to filter pivot tables easily by selecting time ranges - either by year, quarter, month or day. It's nearly a useful tool, ...
Andi Mohr's user avatar
  • 4,245
6 votes
6 answers
29k views

Inserting a signature automatically into an Outlook Calendar meeting request

Is there a way to automatically have a signature inserted into a Microsoft Outlook Calendar request, as one can do with emails?
user avatar
6 votes
1 answer
2k views

How to create a Call Diagram for Excel macros?

I have an Excel file with multiple VBA-Macros. For documentation purposes I want to create a UML Call Diagram, or similar that represents which macro calls which other one. Is there a way to ...
Angelo Fuchs's user avatar
6 votes
1 answer
5k views

How to use the autocomplete feature for VBA function in Excel 2007 with Excel Add-In

(cloning from question on SO) I created a function in VBA. I want Excel 2007 to show the Autocomplete when writing this function in the cell's Excel. Detail as How to use the autocomplete feature for ...
Nam G VU's user avatar
  • 12.3k
6 votes
1 answer
4k views

How to auto advance a PowerPoint slide after an exit animation is over?

PowerPoint entrance animation set up with "Start: With Previous" starts right when a new slide is advanced. However, if you set up an exit animation in the same way, it doesn't start with a slide ...
joooc's user avatar
  • 161
6 votes
1 answer
610 views

Word 2007 macro gone

I have programmed a little macro for text search in Word 2007. I tried to install it on other accounts in our company with very strange results. On two accounts it worked like it should. On other two ...
user48604's user avatar
  • 543
5 votes
5 answers
12k views

Excel VBA program only running at 25% speed

I have a VBA program running on my quad-core Acer Aspire S3 Ultrabook. The trouble is, it only uses 25% of the CPU (the other processes combined use ~1%). The laptop runs Windows 8.0. The Excel ...
tropical's user avatar
5 votes
4 answers
31k views

Quickly delete all floating picture in Excel sheet

I have a lot of photos in my Excel sheet. I want to delete them all - currently Ctrl-A just select all cells. How can I select all photo objects?
Nam G VU's user avatar
  • 12.3k
5 votes
4 answers
5k views

How can I record a transition from a 0 to 1 in a column in Excel?

I need to record the number of transitions from a down state (0) to up state (1) in a single column in excel and I am wondering whether there is some kind of logic like this available in Excel or ...
Imad 's user avatar
  • 51
5 votes
1 answer
7k views

MS Word: How to remove all tables?

I need to run text-check program on my doc (Grammarly), and I need to remove all the tables. How can I do it? I find https://www.extendoffice.com/documents/word/1208-word-remove-delete-all-tables....
ZK Zhao's user avatar
  • 261
5 votes
5 answers
92k views

How can I view the properties of a button on an Excel Worksheet?

I have an Excel document that I need to modify. This thing was created by a "guru" and has been locked down from almost any form of modification. I have the master-password to access the VBA ...
RLH's user avatar
  • 4,415
5 votes
4 answers
17k views

How to increase row height in Excel by X. ie. Add vertical cell padding

I have this report and I want to increase the vertical cell padding to make it easier to read. Now, typically you could just select multiple rows and change the row height until you're satisfied. ...
user606723's user avatar
  • 1,528
5 votes
4 answers
18k views

How can I insert the quoted price of gold from kitco.com into my excel spreadsheet?

kitco.com provides a realtime price quote for gold and other metals. I have a spreadsheet which makes calculations based on the price of gold and would like for this realtime value to automatically be ...
Joe R.'s user avatar
  • 451
5 votes
6 answers
10k views

Is there a way to tell which cells reference a selected cell in Excel?

In Excel, you can tell a cell to reference another cell in order to calculate its value. I'd like to be to do the opposite, to get any cells that reference the currently-selected cell. Is this at all ...
Daniel T.'s user avatar
  • 913
5 votes
2 answers
7k views

A thousand JPEG images in a Word document: how can I format them in the same way?

Please suppose you have a Microsoft Word 2007 document: you have just inserted in it about a thousand of JPEG images. With the first image, you do right-click, then FORMAT PICTURE, then option "...
UltraCommit's user avatar
5 votes
1 answer
540 views

Making it so users that do not have macros enabled cannot see other sheets

I am working on a project that wants all users to have macros enabled. It is a shared sheet so I cannot simply hide everything as a baseline and unhide the sheets when Open_Workbook is ran. My goal is ...
Thomas Wohllaib's user avatar
5 votes
1 answer
1k views

VBA that can delete a row from a range where there is no text, although the cell has a formula

I’m creating an automated report template that fits onto one page. This report includes bullet points and a chart. Because of a presentation request I need to make sure the chart always sits the same ...
RocketGoal's user avatar
  • 1,528
5 votes
2 answers
20k views

How to assign a keyboard shortcut for a powerpoint macro

I had written a VBA code for powerpoint to go to a specific slide while editing the slides. However, I was unable to bind that to a shortcut key (I wanted to bind it to Ctrl+G). In excel there ...
Prasanna's user avatar
  • 4,074
5 votes
2 answers
37k views

How to make the FIND function in Excel ignore case sensitivity?

Say I have an Excel sheet of 100 records where there are 3 columns A, B and C. The requirement is I have to get all the rows from column C if the text in column C matches with SQL Server. Here the ...
user avatar
5 votes
3 answers
123k views

Trigger macro with ONE click on specific cell

Would you mind pointing a way to start a macro in Excel 2010 by clicking only once on a specified cell? I had seen a solution somewhere, but now I can't trace it back.
Noob Doob's user avatar
  • 445
5 votes
3 answers
3k views

Pressing a button to cycle through a range's values

I'm trying to create a button to automatically fill in cell B5 with information from another sheet's cells A1:A10. When the button is pressed I want B5 to contain the info from cell A1. Then, when ...
d123's user avatar
  • 51
5 votes
1 answer
18k views

How do I export all images from Excel and give a name from a related cell

I've got an excel-sheet with about 200 rows. There are 200 images and 200 names. I have to extract every image and give the related name. The structure is like this: Image -> A2 Name -> B3 ...
Colin's user avatar
  • 51
5 votes
2 answers
490 views

How can I add / upload bulk entries to Excel 2010 Autocorrect?

I currently have about 200 entries of autocorrect but it's painful to add one by one manually to "autocorrect" (File > Options > Proofing > AutoCorrect Options > AutoCorrect tab). These entries are ...
Melvin's user avatar
  • 51
5 votes
1 answer
4k views

Excel: Dual graded color scales

Is it possible to do conditional formating for two graded color scales over the same cells? For example I wish to conditionally format a cell such that its color is: Green to Blue graded scale for ...
Mundi's user avatar
  • 173
5 votes
2 answers
2k views

how to remove or change background fills in all tables in a microsoft word document

I have a bunch of large documents, with many tables that have different and inconsistent fill styles - some of them are not readable in black and white when printed. I cannot change the background ...
PA.'s user avatar
  • 716
5 votes
4 answers
57k views

How can I remove the space between dollar sign and value in Excel cell?

I have some cells labeled as euros and some as dollars. For some reason the dollar sign is left-justified with a space between it and the value. The cell is right justified. How can I get the ...
Edward Tanguay's user avatar
5 votes
1 answer
8k views

How do I replace all breaks in a selection in Word using VBA?

I've got a part of a document selected, and now I want to replace all manual page and section breaks (the latter of all types, such as next page even, next page uneven, next page, continuous, column) ...
Ernst's user avatar
  • 169
5 votes
2 answers
8k views

VBA Runtime error 1004: Method 'OpenText' of object 'Workbooks' failed

After an upgrade to Excel 2010 (from 2003), a script used for standardizing data from Access import has stopped working. It returns an error: "Run-time error '1004': Method 'OpenText' of object '...
music2myear's user avatar
  • 41.7k
5 votes
2 answers
25k 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 ...
user avatar
5 votes
2 answers
3k views

Allowing users to unhide (format) only chosen columns

TL;DR, what I want to achieve: Hide some columns which I do not want to show to anyone (check) Hide some columns which I want to show only to some users (check) Set separate passwords for both ...
xchru's user avatar
  • 51
5 votes
2 answers
6k views

Finding multiple local maxima and placing data labels on corresponding chart

Spectrum that I am using complete with 10,000 data points I am a chemistry student of sorts and I frequently have instances where I need to find multiple peak heights (as seen in the attached picture)...
Nicholas Brandon's user avatar
5 votes
1 answer
4k views

How do I package an Outlook 2010 macro for other users?

What is the best means available from within the MS Office 2010 suite to package up macro code written for Outlook, so that I can make it available to my coworkers and make it easy for them to install ...
eksortso's user avatar
  • 155
5 votes
1 answer
5k views

How to filter source sheet in Excel pivot table drill down?

I record my expenses in an Excel spreadsheet. In a second sheet I have a pivot table that allows me to group my expenses by month and by category to see the totals. If I double click on a cell, a ...
Patrick J Collins's user avatar
5 votes
1 answer
1k views

Delete or create Excel cell cell style group

In Excel, the built-in cell styles are grouped. There is "Good, Bad and Neutral", "Data and Model", "Themed Cell Styles", etc: Is there a way to interact with these groups? Like, can I delete an ...
ElRudi's user avatar
  • 424
4 votes
3 answers
4k views

Calculating the average of variably sized blocks of numbers within a column?

In column A I have a set of numbers (over 1,000), and I want to get an average of a block of them at a time, (e.g., 10, so A1:A10 then A11:A20 and so on) and write these averages into column B, such ...
user avatar
4 votes
1 answer
3k views

Excel format from mm/dd/yyyy to mm-dd-yyyy

I am trying to convert a date from a format with slashes to one with dashes. however when i try: =SUBSTITUTE(B3,"/","-") It converts my the would-be date into a date integer. I have tried formatting ...
NebDaMin's user avatar
  • 147
4 votes
2 answers
496 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. ...
Makah's user avatar
  • 153
4 votes
2 answers
8k views

How can I modify the "Applies To" property of a Cell's Conditional Formatting rule using VBA?

I'm attempting to use VBA to create a conditional formatting rule and apply it to multiple cells. I've attempted this is by creating the rules for one cell only and then editing the appliesto ...
dutsnekcirf's user avatar
4 votes
3 answers
19k views

How can I 'align right' the results of Excel's "Text to Columns" feature?

If I am using the Text to Columns feature on the following data, using ";" as a delimiter: foo;bar;qux;baz;toast; quux;jam;beans; I'll end up with the results "left aligned" in the resulting ...
Some_Guy's user avatar
  • 754

1
2
3 4 5
75