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
171 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
95 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
87 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
2k 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
109 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
120 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
57 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
54 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
36 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
51 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
1answer
59 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
42 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 ...
0
votes
1answer
32 views

Get result of formula as text

I have an Excel doc which populates a matrix using formula, for example; | A | B | C 1|=1+2 |=2+2 | 2| | |=4-1 would display as; | A | B | C 1|3 |4 | 2| ...
1
vote
1answer
164 views

Excel: create folder VBA script - get value from selected cell?

I am using a VBA code to create a new folder in a directory. What I want to do is get the new folder name from the selected cell. Any ideas how I can do this please? Here is the code I have so far. ...
1
vote
1answer
59 views

Outlook 2013 VBA: Refer to editor in reading pane

I am trying to assign a category to a message when sending it (a 'Send Now' category to override a send delay). The macro below works fine when editing the message in a separate window, but it hangs ...
0
votes
1answer
164 views

Merging multiple excel files in to one file

This is my macro for merging all the files in one directory to one excel sheet. I am unable to find why its not working as per expectation. I have thousand rows in each file. It copies 1000 rows from ...
0
votes
0answers
17 views

Linking a cell to a specific part of an ActiveX textbox

Is there a way in Excel to have a cell refer to a specific part of an ActiveX textbox? I have a large list of references in one ActiveX text box, and in another sheet I need to input various ...
1
vote
1answer
78 views

Working with cell addresses in excel with VBA

I have a Excel sheet in which are multiple forms. The forms look all the same and they have exact the same cells between them. They are ordered in 4 x 3: x x x x x x x x x x x x x x x x .... There ...
1
vote
1answer
45 views

Automatically “comment out” formula in Excel?

So I have this result set in MS SQL Management Studio. And I have an Excel sheet. I copy and paste data from MSSMS to Excel. As far as good. Now, some of the fields start with an equals sign. Excel ...
0
votes
2answers
161 views

How to repeat "copy range (A1:A5) to Range B with transform (column to row)?

I have a data in the Range A 1 a1 2 a2 3 a3 4 a4 5 a5 6 b1 7 b2 8 b3 9 b4 10 b5 and I copied A1 to A5 to Range B10, B1 to B5 to Range B11, C1 to C5 to Range B12 and so on with transform (from ...
0
votes
1answer
20 views

Loop in Active Table Cell

I am now working from the top of the Active Cell with this code: Selection.EndKey Unit:=wdLine Selection.TypeText Text:=", " Selection.Delete Unit:=wdCharacter, Count:=1 I need it to loop until the ...
0
votes
0answers
63 views

Powerpoint loop single slide until click

I have a slide with some animation. I want at the end of the slide for the animation to repeat continuously until I mouse click or press ESC. Is there any way to do this? (Even programming with VBA ...
1
vote
1answer
572 views

Outlook VBA - how to copy the currently selected text into clipboard?

My question How can get the currently selected text in Microsoft Outlook 2007 in an open message window or in the currently selected message in the preview pane and copy it into the clipboard? ...
0
votes
1answer
58 views

Create button in Powerpoint 2013 ribbon that opens a hyperlink

I'd like to create a button that automatically opens a hyperlink from Powerpoint. It's easy enough to create a hyperlink in Powerpoint (Insert -> Hyperlink) and then click on that hyperlink. I want ...
-1
votes
1answer
41 views

Execute an Excel 2010 Add-In

An excel add-in seems to be the easiest way to share a macro I created with my team. I saved the workbook as a .xlam file and installed the add-in so it shows up under the addins button with a ...
0
votes
2answers
937 views

move worksheet to another workbook, without the vba code but keeping the colour scheme

I current have some code that first copy a worksheet do some cleaning and then move it to another workbook. My problem is that when i copy or move a sheet it also copies the vba code that is attached ...
0
votes
1answer
69 views

How can I send a command to Emacs 24 from VBA in MS Office?

I want to invoke commands from within MS Office application which have a direct effect on my (open) Emacs application, for example do a search for the currently selected text in Emacs I wonder how ...
0
votes
0answers
104 views

Could not load an object as it is not available on this machine - Excel 2010

Got an issue that is driving me mad. Every time a user accesses this file, he always gets the error messages: "Could not load an object as it is not available on this machine" & "Compile error in ...
-1
votes
1answer
154 views

VBA AutoFilter gives runtime error 1004

Could anybody help me find what's wrong in the autofilter line below? It gives run time error '1004'. Sub filter() Dim rng_source As Range Set rng_source = ...
5
votes
5answers
2k 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 ...
3
votes
3answers
335 views

Custom Sort using Excel without Custom List

I want to be able to sort excel rows where data looks like Column - 1 Other Columns 701-GBL-1843-MLMK blah 566-JJB-2785-MYJW 254-WYD-3220-NAND 884-GLE-2843-FRYA And I want ...
0
votes
2answers
60 views

Expand Excel ComboBox on click [on hold]

How can I set up my combo boxes on the form i am building to open automatically when clicked on the field portion not just the arrow? I have been searching for a while and I can't seem to find any ...
1
vote
0answers
54 views

How do I get an event to fire when the slide changes in PowerPoint?

I already know of two supposed fixes, which I will list below, along with the reason they don't work for me. The first is to use the SlideShowNextSlide subroutine. The problem with this is that it ...
-1
votes
1answer
3k views

How to write Excel macro to copy selected row of data between two sheets?

I'm not really experienced in the whole VBA area, i get how macros work but this is just out of my reach. Basically as i stated in the title i need to write a macro that will copy the selected row or ...
0
votes
1answer
54 views

Automating building a table from web sources in MS Excel 2013

I want to build a table indicating a number of things available in a given market. To do this I access the sites with relevant information and copy numbers to a table each day. I would love to ...
0
votes
1answer
112 views

Apply a formula to an entire column since the number of rows is changing from a source file?

I have a connection to a text file source so the excel worksheet updates automatically. Therefore the number of rows is always growing every time it updates. How can I apply a formula to an entire ...
1
vote
2answers
407 views

VBA Copy/Paste Runtime Error

This block of code keeps receiving a Runtime error 1004. I am trying to copy small blocks of information from one sheet to the other if the beginning column names match. For a = 8 To 17 For b = ...
0
votes
1answer
825 views

Copy from sheet2 to sheet1 based on if values match

The goal of this code is to iterate through a column in sheet1 and check to see if each value matches that of values in a row in sheet2. If the value matches, copy 5 rows of information from sheet2 ...
0
votes
2answers
27 views

Error when value not present

I am using the code below several times over in one sub for different values not just "CPNEC". It works fine where there is a range with that value on the spreadsheet but falls over it the value does ...
-1
votes
2answers
252 views

how to create excel charts having strings in both x and y axis

I have a student data with Student Name and their grade (A/B/C/D/E.). Now I want to have a graph for this data. Kindly help me.
0
votes
2answers
87 views

How to shift unique values down a column to the same value in another column?

My friend has two columns where one has unique values and another column has those same values but also duplicated like shown below Column 1 Column 2 ABC123 ABC123 CDE456 ABC123 EFG789 ...
0
votes
0answers
27 views

My f8 key is an lcd screen and I want a tactile button to step into a program. Is there any way to change it to another key?

My f8 key on my new laptop is an lcd screen and I want a tactile button to step into a program in a VBA build eviroment. Is there any way to change it to another key? FYI, I'm writing macros for ...
0
votes
0answers
57 views

Excel 2D-lookup on a PivotTable with changing coloumns and rows

I want to do a Vlookup on a 2D pivot table but neither the coloumns and rows of the pivot are fixed and are subject to change due to ever changing data source. How can I perform a accurate vlookup on ...
0
votes
0answers
64 views

VBA Compare columns on two diff worksheets, find in 2nd and group on 2nd worksheet

Excel 2010 Hi. I have a 6,000 line spreadsheet and need to group the lines, based on identified roll up points in another spreadsheet (150 roll up points). I want to be able to see the summary ...
0
votes
0answers
96 views

Using VBA to change criteria on a query based on a table content (in Access)

I'm relatively new to VBA in Access and need help to automatize something. I have a query with my salespeople performance month by month. I use one criteria to filter the information by salesperson. ...
1
vote
2answers
50 views

String Manupulation in VBA

I have single column that needs to be split to multiple, like Text-to-columns in excel. However there is a small challenge. Conventional delimiter will not work. Consider the string below Original: ...
0
votes
1answer
86 views

How to make a named cell read-only

I would like to make a cell "Cell Name" read-only. I found this code here but don't know how to use the String value instead of the range: Private Sub Worksheet_SelectionChange(ByVal Target As ...
0
votes
0answers
230 views

Runtime error 9:Subscript Out of Range near end of code at “Worksheets(”UserForm“).Select”

The following code is for a userform, the user having three options, one being less than 70,000 square feet, one being between 70,000 and 150,000 square feet and one greater than 150,000 square feet. ...
0
votes
2answers
81 views

Combine Multiple Values into Rows with Blanks

So I researched this for awhile, but I seem to be hitting a wall. I will admit- I successfully did this once, made a tutorial for my coworkers- then I nor anyone else was able to replicate the ...
2
votes
1answer
195 views

VBA selecting range in Excel

I can set the range for all of a column such as : ActiveSheet.Range("A:A") But I'd like to set something such as ActiveSheet.Range("A10:A") but there doesn't seem to be an easy way to do this ...