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

Excel Macros 2013: Is it possible to create a Macro that, with the shortcut key, formats an input value between Whole int and 2 decimal places

I am attempting to create an Excel spreadsheet which holds information of students data, currently I have rounded all data to the nearest whole int. What I wish to know is whether there is a way to ...
0
votes
4answers
47 views

Getting last cell in row with data and corresponding data in column A in Excel

I have a spreadsheet that in column A lists dates. Column B may or may not have data in each cell. The question I have is when I grab the last cell with data in column B, how can I also grab the ...
0
votes
2answers
47 views

Remove space before specific text excel

I have a list of 1000s of different labels and need to remove the space between the number and mg. Sometimes the space is present and other times it's not. The position of the text "mg" is not the ...
0
votes
1answer
21 views

How to search a range of cells for specific txt, then copy to adjacent cell

I have a range of cells, e.g. g1-g1000 that contains two type of entries: xx.xx or xx.xxCR, where xx.xx are numbers. I want to search the range of cells for xx.xxCR and when a cell is found, copy ...
0
votes
0answers
29 views

Delineate Excel Formula Without Using Wizards

Is there a combination of excel formulas that I could use to do this without using VBA or the import wizard? I know how to insert comma delimited data from a text file and to split a cell into ...
1
vote
1answer
43 views

In Excel, populate array based on table with value (and coordinates for desired array cell). All array cells are populated (default to be zero)

I am reasonably good with Excel but a near novice at VBA. I have a three column table. Column A & B have coordinates for an array, with column C having the value to be placed as defined by the ...
0
votes
0answers
26 views

Error when running a VBA in Excel

I am trying to merge 150.000 different .xls files into one only one master sheet. I have done this many times before but I am suddenly receiving a error in the middle of the process. Here is the VBA ...
2
votes
0answers
100 views

Have a different style set in different sections of the same Word document

I have a document "template" (not yet a template file type - I hope to create that as described below) for a report. The report is broken up into different sections: Letter to the Client Table of ...
0
votes
1answer
41 views

Macro to fill in cells from a column sequentially when I click on a button

I'm having a lot of trouble trying to figure this out. This is my layout: As you can see, I have 2 buttons. What I would like each button to do is: Each time I click YES, it will insert a Y ...
2
votes
1answer
73 views

Is it possible to automatically add cells from a new sheet to a formula in Excel?

I would like to make a new financial spreadsheet for tracking expenses. Since the expense sheets are created as and when I cannot pre-generate a spreadsheet to populate with formulae. I have a summary ...
0
votes
0answers
77 views

VBA: Change highlight color (RGB not wbColor) with keyboard shorcut (MS Word 2013)

I have this module in VBA assigned to a keyboard shorcut to change the color of highlight: Sub RotateHighlightwbColor() Select Case Selection.Range.HighlightColorIndex Case wdYellow ...
1
vote
0answers
56 views

How to change Control-Y behavior in Excel-VBA's IDE

Excel VBA's IDE register's a Control-y as "cut this line of code". By contrast, redo-ing is accomplished by Alt-e, R. Is there any way to change this behavior and make Control-y be the much more ...
0
votes
2answers
20 views

Can a macro be set up to hide data and images?

I was able to create a macro to hide rows, but the images wont hide. What am I missing?
0
votes
1answer
27 views

How do I create a back button in excel

I need to create a back button in excel, which allows the user to go back to the previously viewed worksheet. Not sure how to do this in VBA, any thoughts would be appreciated. Thanks, Dave.
1
vote
0answers
58 views

Excel VBA that calls Powershell ActiveDirectory cmdlet, but Module won't load?

I have a powershell script I use to dump user and computer lists to csv files; it works great and I don't want to touch it much. It uses the ActiveDirectory cmdlet, and the Get-ADComputer and ...
0
votes
1answer
83 views

Combine duplicates in Excel based on values from 2 columns, produce the sum and and % from others, remove dups

I have been struggling with my Excel report trying to roll up duplicate rows based on 2 column values. Also need to calculate the sum of the 3rd and 4th column and calculate the percentage. Here is ...
0
votes
0answers
72 views

Excel 2010 shared workbook - image buttons disabled

I have several Excel workbooks which were originally created in a 2007 version. They are shared workbooks, and contain some VBA code, and are protected to prevent users from changing certain content. ...
0
votes
1answer
70 views

Excel 2010 workbook startup error

I have an Excel workbook that causes an error when it is started on a particular PC. No other workbooks give the same error on this PC, and the workbook itself causes no problems on any other PC. The ...
2
votes
1answer
69 views

Word 2010 VBA applying styles but not changing font

I don't use VBA that often, and I'm trying to put together a macro which selects all text in the document with font size 13.5 pt and changes its style to Header 1. So far I have the below code: Sub ...
0
votes
2answers
280 views

Referencing cell only by column name in Excel 2010 VBA

In Excel 2010, I need to go through a data table row by row and manipulate the data in VBA. My original function reads like this: Private Function GetValue(ByVal myRange As Excel.Range, ByVal strCol ...
3
votes
0answers
44 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 ...
0
votes
0answers
50 views

How to change the colours of sparkline axes individually

I found the following code (in the office docs) which allows me to change the axis colour of a group of sparklines: Sub AxisColor() 'The sparkline group Dim oSparkGroup As SparklineGroup ...
1
vote
1answer
92 views

VBA - Populate cell if adjacent cell is not empty

I have created a macro that opens and edits excel workbooks for me. Firstly, it adds a new column A and then changes the title for A1, B1, C1, D1. After this, I want to create some sort of formula ...
1
vote
1answer
130 views

Excel VBA User Form option buttons

I've created a userform that will require an option button to be selected (thus emailing the intended recipient), otherwise it will display a msgbox. I'm having a problem with the If And Then Else ...
0
votes
2answers
211 views

Update and Append Rows based on Two Criteria in VBA Excel

Could anyone help me write a code in VBA that updates a table, or appends new data based on criteria in two columns? For example, there might be a name column, and a project column, and we want to ...
0
votes
1answer
23 views

Determining which column is visible to the right of a frozen pane in VBA

I'd like to determine in VBA which column is shown directly to the right of a frozen pane, in the example image, it would be column G. See the picture for reference. Any ideas?
-1
votes
1answer
196 views

Excel VBA copy value to new

I'm brand new to VBA and macros. I've been stumbling along rather decently, but I've come across this problem and I'm not sure how to tweak the code. I need the user to be able to enter a value ...
2
votes
4answers
4k views

Excel runtime error “32809” corrupt workbooks?

Currently facing an incomprehensible issue with Excel... We have developed a work order electronic package that is used by about one hundred users every day. It is essentially the exact same workbook ...
0
votes
1answer
22 views

How do I get URLs from hyperlinks in Excel 2010?

I have a column of cells with hyperlinks (to web addresses) and I need their URLs to be regular text. Is there a way to extract the URLs from hyperlinks? Example: Cell says: "CLICKME" Links to: ...
0
votes
0answers
36 views

Access 2007. Make each string in text box clickable?

Access 2007. Database table tblUsers, column tblUsers.fldItems. That column can contain nothing, one word or a delimited list of items (brush, comb, sprocket). In a form I have a text box ...
0
votes
1answer
38 views

Intersect ERROR:Method 'Range' of object '_Global' failed

Why A get this error: Method 'Range' of object '_Global' failed When I Put: Private Sub Workbook_SheetChange(ByVal WS As Object, ByVal Target As Range) Dim NTT As Range Set WS = ActiveSheet Set NTT = ...
0
votes
1answer
27 views

Excel 2013 global automatic macros

I am trying to log the opening and closing of excel workbooks to replace the Journaling capability in office. I have created and tested VBA auto_open and auto_close macros in excel, which log these ...
0
votes
1answer
31 views

Inserting 'n' blank rows using a macro

I am currently trying to develop an excel spread sheet to make it easier to format. What I would like to do is create a macro to insert blank rows in multiple places without affecting subsequent rows. ...
0
votes
2answers
64 views

How do I copy value in different column from previous row if the cell is not empty?

I have the following situation: A B 19260218 234 77 ok 3 ok 19310328 174 46 2 When the value in column B is numerical, I have a ...
3
votes
1answer
44 views

Why can't I use a number wildcard to in Cells.Find in VBA?

I'm trying to search my Excel worksheet for any cell that has a value that begins with a number followed by a period, but this isn't working. Does anyone know why not? Cells.Find(What:="[0-9].", ...
0
votes
1answer
33 views

VBA Code for changing background text for any text within a cell

I'm trying to make a row change colour to yellow based on if any text is within the D column. I have already set up 5 different colours for another cell, however need this to over-ride those ones. I ...
0
votes
1answer
37 views

Excel VBA: Intersect methode with several names range [closed]

The Intersect don't work. Dim NTit As Range Dim NInf As Range Dim NDat As Range Dim WS As Worksheet Set WS = ActiveSheet Set NTit = WS.Range("$A$1:$J$1") Set NInf = ...
-1
votes
1answer
15 views

Where to put the Change Event Code

CHANGE EVENT: I have 12 sheets in a workbook. Do you have to put the Change Event in the 12 sheet, if not, where I must put the code for this event.
0
votes
1answer
78 views

How do I generate random numbers between a range in cells? [duplicate]

I'm wanting to create a button that generates a string of 10 random numbers into cells, and pulls the range for these random numbers from, for instance, in B1 and B2. Basically, I'm looking to use the ...
0
votes
0answers
20 views

Date FileDateTime in sharepoint

Sub Test() myURL = "http://sps.ap.emersonprocess.com/sg/pssops/svcops/APServicePortal/ChartTemplates/ Filename = "IBS-CCR-AP_Prod.xlsx" myURL = Replace(myURL, "http:", "") myURL = Replace(myURL, "/", ...
1
vote
1answer
80 views

EXCEL - How to use two cells for input and output at the same time [duplicate]

I have 3 cells, VALUE, DOWNPAYMENT, DOWNPAYMENT %. The 3rd cell "DOWNPAYMENT %" calculates the percentage of "DOWNPAYMENT" over "VALUE" Is there a way for the user to have the function to input a ...
0
votes
2answers
74 views

MS Access 2010 maximum number of records

I have VBA program written in Access 2010. It creates and populates a table from a text file. Previously, there have been less than 20,000 records total. With the current data set, I get an ...
0
votes
0answers
28 views

Which ODBC connection properties have higher priority ?

I take data from PostgreSQL via ODBC and put the data in excel worksheet. For this I use VBA which makes a query table. In the VBA script I specify a connection string which contains some ODBC ...
0
votes
1answer
68 views

How to control excel cells together with vba script?

In the userform there are product names (combobox) , prices , amount (textbox). For product name control I use with combobox . I write amount of product to my textbox as a manuel when I choose the ...
1
vote
1answer
137 views

How to add photos to specific cells in my Excel worksheet from my computer? [closed]

This is the code which I used : Private Sub Image1_Click() Range("C1").Select Application.Dialogs(xlDialogInsertPicture).Show End Sub Private Sub Image2_Click() Range("D1").Select ...
0
votes
0answers
50 views

Import/export conditional formatting rules in Excel 2013

Is there a way to import/export conditional formatting rules in Excel 2013? Possibly using VBA?
1
vote
3answers
31 views

Splitting Data in Excel Based on Character Location

I have a column of data, each row containing a set of 83 characters (e.g. 010203 344345 929348238482abcde33 4566) with no particular pattern that needs to be split into blocks of different lengths ...
0
votes
2answers
120 views

excel vba codes user form

I have created a user form for my work book. I would like the user to navigate their way around the workbook using the button on this user form. Is there any code that I can use to limit the user by ...
1
vote
1answer
96 views

excel vba userform/button coding

I have created a workbook in Excel. To navigate I have inserted a userform. I have code which takes me to a spreadsheet once a button is clicked on the userform. Now I would like a button on the ...
0
votes
0answers
26 views

How to have excel 2007 userform stay on top of all other windows

The title says it all really. I have a modeless form generated in excel 2007 that'd ideally stay on top of all other windows (not just excel). I know other applications can set this, but I'm unsure ...