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
6 views

Dynamically reference name manager names in excel

I have survey data and I want to look at respondent data by country of origin. I have 1 column of indicator variables per country and I've used Name Manager to define each country's name (e.g. China =...
0
votes
0answers
5 views

Cannot Select Pivot Table Ranges in VBA

I want to format the data section (excluding the header row) of a Pivot Table in code. Several websites tell me how to identify the various parts of a Pivot Table, but the code doesn't work the way ...
0
votes
0answers
4 views

Formatting dates as dates in Access

I'm embarrassed with a seemingly very simple problem. I have about 7 million of rows in Access, with a date column formatted as numbers. They are the 5 digit type of numbers excel uses when dates are ...
0
votes
1answer
21 views

VBA Function to parse email body for email address, write to excel

I have a requirement such that I need a function to iterate through all emails in an Outlook (2010) folder and grab an email address from the body of the email. The emails are found from Inbox \ ...
1
vote
0answers
19 views

Block Network access for Microsoft Excel

I have a macro that is stuck on running and has frozen my Excel. Basically its a loop through roughly 80000 rows performing SQL queries on each row with ADO.DB Save disabling the network card, is ...
0
votes
0answers
20 views

Excel 2013 single column values multiple worksheet changes

I have been tasked at work with creating a calendar template that can be used by multiple groups with a standard set of variables & color coding. Okay, not a big deal since Excel has some ...
0
votes
0answers
11 views

AutoFit Cell content when printing

enter image description here I created an excel application where the users enter the comments for every question. I have designed the excel spreadsheet in such a way that, I have merged cells to ...
0
votes
1answer
22 views

Excel Macro: update sheet or create a new one based on a single criteria

I want to write a macro which updates a single sheet out of many in an Excel workbook, based on a single criteria. The first sheet of my workbook is titled "Input"; I copy and paste a client's ...
0
votes
1answer
18 views

Clearing a value when an option is selected from a drop down menu in Excel (VBA)

Good Morning, I'm trying to write a code in VBA, that while selecting from a drop down menu from D2, it will clear any value from E2 and F2 without removing the formatting. I have tried the follow ...
-1
votes
0answers
11 views

Parse Excel to xml using vba using Excel column data as XML attributes

I have an Excel table with data in column1 and id's to this data in column2. column1;column2 dataCol1Row1;dataCol2Row1 dataCol1Row2;dataCol2Row2 Using any of the VB examples given in Parse Excel ...
0
votes
0answers
16 views

dependent drop down selections

How can I create two drop down boxes which are dependent on each other while each drop down list is in numerical or alphabetical order depending on the data in each list? Drop box A is numeric and ...
-1
votes
0answers
21 views

Copy and run procedures on sheet tab names

I have a spreadsheet with a list of sheets each sheet has a Region name. Step 1 Open file called "NameofFile" When the below code moves this to a new book I want to give the name or save file as "...
1
vote
1answer
16 views

Is there a way to protect (“lock”) an MS Word Document such that even selection is disabled?

I'm looking for a way to completely "lock" up a Word document, so that users won't have the option of selecting the text and copying/pasting to other application. Ideally, I would like to code a VBA ...
0
votes
1answer
13 views

Reset code and userform window positions in Microsoft Office VBA

When we open UserForms and code modules in a Microsoft Office VBA project (Word, Excel or Access), we can change the size and location of these windows. MS Office saves the last position for these ...
-1
votes
0answers
9 views

Changing VBA when new rows are inserted

I have an Excel spreadsheet that has become quite complex at this stage. There is a fair amount of VBA code which I have either written or had people have told me what to write (from forums etc.) ...
1
vote
0answers
5 views

MS Outlook How to Alter Subject Line (Strip RE:/FW and Add Prefix)

I want to alter the subject line for incoming and outgoing emails via auto macro. Here is what I have been searching for: A macro to automatic strip RE:,Re:, FW:, Fw: from incoming emails. I tried ...
-2
votes
0answers
15 views

How to automatically transfer Excel data with no fixed cell reference to a new worksheet or workbook with specified fields

How do I AUTOMATICALLY transfer mixed data to go to specific fields in a new worksheet or workbook. All the Excel data are on separate worksheets. The columns and rows are not similar. The lables ...
0
votes
1answer
29 views

How to change interior.color in excel, across multiple columns using a row variable

I'm trying to highlight a row that's assigned to "RowNum" I want to highlight Columns A through O. I've tried the things below, But receive syntax errors on each. sh1.Cells(RowNum, 15).Interior....
0
votes
1answer
37 views

Separating Names In Excel

I have a list of 60K names. I need to separate them into different worksheets based on their length. I have been doing it using normal way using len() formula, filter them and copy paste them to ...
-2
votes
1answer
29 views

How to remove reference and Use vba code for every machine?

As you suggested I have done changes but still I am not able to make it user-friendly or you can say every time when i have to use this code I have to turn on Scripting Runtime on different computers. ...
-1
votes
0answers
17 views

Macro from source file to destinationfile

I have a source file with a macro in it (.docm). This source file is used to merge data from an excel sheet. The source file is used as a source :P and therefore word opens a new file where the ...
-1
votes
0answers
11 views

How using (office 2016) Excel VBA, Auto copy and/or save a web page image

EXCEL 2010. After navigating to a web page using Excel VBA I wish to copy an image into excel AND/OR save it to a documents folder IE: <img alt="" src="/images/rp_251x251/Product/94031/...
-1
votes
0answers
14 views

Macro replaces values in different cells, only first time used in sheet, how can i fix this?

I co-created a macro that toggle's between European and American data format. But when I run it for the first time in a file it replaces the value in to the first empty row from above. (when i convert ...
0
votes
0answers
25 views

How to *display* a complete HTML table structure inside a single Excell cell?

Can anyone suggest a way that I could accomplish the following? I am fairly skilled with VBA and I am willing to call/use a 3rd party approach (like maybe the WKHTMLTOPDF utility or something) if ...
0
votes
0answers
24 views

Can i modify passwordbreaker to warn for passwords created in MS office 2013 and 2016? (VBA) [closed]

When a sheet is protected from up to version 2010 in Excel, it is possible to use the passwordbreaker macro as stated below to break the password: Dim i As Integer, j As Integer, k As Integer Dim ...
1
vote
1answer
32 views

Can't make the import sheets from directory function dynamic?

Can I modify the code below into a dynamic import of sheets, so I can run it in any sheet from my personal macrobook instead of a sheet called import-sheets.xls? Found the code for importing below. ...
0
votes
2answers
18 views

Using Excel VBA to find last matching row

I have a spreadsheet that includes a date and an ActionCode column. I'm using the Worksheet_Change event to run some code after the user enters an ActionCode. I'd like to have a procedure that (when ...
1
vote
0answers
36 views

macro's gone before/after saving to .docm

I am working on an excel file that opens a source document(word) that I want to save to another name but with the macro's from the source. Opening the file is not the problem but after this merge (I ...
-2
votes
0answers
16 views

Combine Certain Part of Certain Tabs From Hundreds of Workbooks

I'll try and be as clear as I can. What I need seems very simple but I'm really struggling (I'm fairly new to VBA). I have 700 separate workbooks that I need to combine, removing the duplicates as ...
0
votes
0answers
20 views

Separating two runs of data

I am taking data measurements on a machine (measuring laser power) It runs at 10% power, then 25%, 50, 75, and 100 with cooldowns in between for two separate optics. Each run is not a constant length ...
0
votes
0answers
29 views

Taking multiple averages from one set of data

I have a machine spitting out data files that I want to analyze quickly. There is one column of data (thousands of readings). These values are laser power readings. The machine has two lasers and it ...
-1
votes
0answers
16 views

Outlook not sending emails when oopened and closed

Thanks for the response. .Send is giving me Application-defined or object-defined error I have added .Session.SendAndReceive(False. But it is still displaying the email instead of sending it. Please ...
0
votes
1answer
21 views

Not Sending an email when Outlook is closed and opened

I am making code changes to support Outlook. I am having problem sending email when I first open outlook i.e. it displays an email instead of sending it. But from the second time it automates email. ...
0
votes
0answers
13 views

How to edit a shared excel addin that is read only (and block it from locking in the future)

I created a useful excel addin that builds an automated report. The addin is shared on a server where a few people use it, but I recently found a small bug I want to fix - however when I open, edit ...
0
votes
0answers
9 views

Update column / row labels of pivot table from a named range

I have a pilot table with one column label and one row label, like this: Month: Jan Feb Mar ... State: -Texas -Illinois ... I want to be able to choose which states to display AND in which order ...
0
votes
2answers
38 views

Making Text To Columns Range Dynamic

I would like to make the text to columns range dynamic in my macro. But if i try to put the myRange in there it doesn't work. I can't find any information around the web to make the text to columns ...
0
votes
0answers
8 views

Export all Access 2010 tables to text file, with table names + delimiters

I'm trying to to loop all tables in an Access 2010 database, and for each table, append the following to an output text file. I can loop all tables, and I've found the general guidance for DoCmd....
0
votes
1answer
56 views

Excel Transposing Every nth row to every nth column

Been trying to figure this out for a while and every solution I've tried hasn't been terribly successful for what I'm trying. Basically what I'm trying to do is take every other row in a spreadsheet ...
0
votes
0answers
16 views

Excel VBA does not save file even when prompt says it will

I have an Excel file that generates reports using VBA. A portion of that process copies data from 1 file to append into another then saves the destination file. The process works on many machines ...
0
votes
0answers
13 views

Trying to automate a webpage that uses iframes. oie.document.frames(0).document.all.Oy [migrated]

I'm trying to create a budget program that will on open open IE and grab an available balance from an account. I have the login progress completed. But after the webpage loads, it starts to ...
0
votes
0answers
20 views

copy data from one opened excel workbook to another opened workbook excel VBA

I try to copy data between two workbooks which already exist but it didn't work. I don't know how to write a code without opening two files every time I run the macro. Sub CopyRangeToAnotherSheet() ...
0
votes
0answers
17 views

Object required error

Forgive me for trying to get into something way above my skill level but I am trying to write a macro in VBA to send data to a website and collect a quote and return it to the workbook but I keep ...
0
votes
1answer
23 views

How do I expand a row into multiple rows with the same data in each row based on the number of the current cell?

Row 1-4 is the example of the data I'm given and I'm trying to achieve rows 7-17. The real list I'm working with is over 10,000 lines long, so if I can use the same formula on the entire list that ...
2
votes
1answer
64 views

Macro to autofill columns in Excel

I've recorded a macro in Excel that fills the columns with formulas.  However, it's limited to the range I was using in my test data, i.e., it doesn't fill down to the last row of data when I use a ...
0
votes
0answers
13 views

Split Excel sheet to Multiple sheets

can anyone help me out on how to split data in one excel sheet to multiple sheets based on two columns criteria us VBA
0
votes
1answer
25 views

Embed OneNote in Excel

I know it is possible to embed an Excel sheet into OneNote... but is the reverse possible? My end goal would be to have a OneNote page directly in my worksheet, so the user can write in OneNote from ...
-1
votes
0answers
28 views

VBA Mail merge save individual docs not working

I have this code which worked before, so I'm not sure what's gone wrong. As far as I can tell the code stopped working after I edited my template, but I can't find anything online about the template ...
0
votes
1answer
24 views

Excel 2010 VBA. input box is deleting formula in cell that it changes

Ok, I'm fairly new to VBA. In fact, I'm a data guy and don't use it much so please forgive me for my lack of knowledge. I have a cell in a sheet that derives it's value from another cell. In other ...
1
vote
1answer
49 views

PowerPoint VBA - Run Macro When Slide Changes in Edit Mode

I know I could do the following to run code when the slide is changed in presentation mode - Sub OnSlideShowPageChange() Dim i As Integer i = ActivePresentation.SlideShowWindow.View....
2
votes
0answers
19 views

Copy sheets to new workbook and clearing contents of cells in the new workbook

I am trying to copy various sheets into a new workbook, however, I would like to clear some of the contents after this is done in the new workbook. To better illustrate it, I have sheets a, b, c, d, ...