Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
39 views

MS Excel VBA to Export to PDF Terminates Suddenly and forces computer to reboot

I have some VBA code (see below) that basically prints named ranges in an excel file to PDF. I have command buttons for each macro and It works fine, but when i'm printing them sequentially you (...
0
votes
1answer
63 views

Change a macro that only works if the range starts with an A1 or T1 etc. cell

I have a macro that works but I would like to change the cell range from Set SearchRange = Range("E1:E12") to Set SearchRange = Range("A21:A32") I have made the change in the code but it won’t ...
0
votes
0answers
24 views

Lock Cells Based on Conditionally Formatted Interior Color

I am working on a project that requires locked cells based on how the cells are conditionally formatted. In this instance the conditionally formatted cells have interior color 15. This is the rule ...
0
votes
1answer
19 views

Data extraction from hyperlinked workbooks

I have hundreds of different workbooks to work with and extract certain data from them and summarize these data in a separate workbook. This overview workbook contains hyperlinks to the single ...
0
votes
2answers
77 views

VBA Error: Out of stack space

I have a very simple macro in an Excel sheet, to allows users to recalculate. I have no other macros/code in the workbook, and only this work book open Sub Calculate() Calculate End Sub This is ...
0
votes
1answer
32 views

VBA - Create and save to folder according to date

I need to do a couple of things that seem to be easy, but I'm having a hard time figuring out how to implement. I need to create a folder using today's date. That part's fine. Then I need to save a ...
0
votes
1answer
57 views

Excel dynamic search vba code

With this VBA macro for Excel I get instant search filter when I type the whole word, but I want it as follows: when I type O for opel, that I get opel already showing. This is the code: Sub ...
-2
votes
1answer
49 views

How to Filter Data Based off Cell Value

I am trying to filter my data based off of a cell value. My data will be a large range for 12 months. So far I am able to filter only one month, I cannot figure out how to filter all 12 months based ...
-1
votes
0answers
39 views

Importing txt-values from FTP

I'm trying to get text in a .txt from an FTP which i want into excel, this is what i got from our supplier support so far: Make a file named GetFromFTP.bat with this in it. echo off c: cd\import ftp ...
3
votes
1answer
288 views

MS Access - Grouped query based on MAX field

I am trying to build a SQL Query that takes the following data: +-------------+--------+---------+---------+--------+ | Primary Key | ID | Version | Class | Fruit? | +-------------+--------+----...
0
votes
0answers
24 views

VBA - Assigning Macro to Form Control Button

I wrote the below code in VBA to delete full rows if, in column U of Sheet21 (actually named "ROG Registration") if "Self Cancelled" or "Waitlisted" appear. When I'm on the ROG Registration tab with ...
0
votes
0answers
20 views

display the message box and sound simultaneously - VBA

In the code below, the song is played first, after which the message is displayed. How to display the Message Box and Sound Play simultaneously in the code below? Private Declare PtrSafe Function ...
1
vote
0answers
58 views

How do I create a dynamic range using calculated cell references?

I'm struggling since I'm not the best with working out the most efficient way to do these things. Check the following: "First row with data: 10". Calculated by a formula that looks for the first ...
0
votes
0answers
35 views

VBA - Filling sequence from 1 to N

I'm not sure the title is clear, but essentially what I need is to automate the assignation of sites. The number of rows is usually around 60, but could go up to 200. The assignation of site number ...
0
votes
1answer
55 views

Find value from drop down on table and compare columns then list differences

I have tried coding this myself with no luck whatsoever (I am a novice). We have a worksheet that contains lists of users, their job titles and roles assigned to them within certain systems. What ...
0
votes
1answer
94 views

14 digit Hex to decimal in Excel

I have 14 digit Hexadecimal numbers in Excel which I want to convert to a decimal number. For example in C2 the number is 0438E96A095180 and that has to be 1188475064373632 in decimal. I have tried ...
0
votes
0answers
61 views

How to fix vba cannot find installable isam error

I have a connection string that uploads a range of cells to my sharepoint list. Today someone was unable to use this feature and received an error when running the macro. The error was Cannot Find ...
0
votes
1answer
63 views

Excel VBA index match a csv import

How can I use an index match function in VBA to find values in a CSV file then import those values to the matched index in a cell in Excel? Say I have a CSV file which contains the following comma ...
0
votes
1answer
77 views

VBA code needed to clear contents of cell AQ when value of cell D changes; Microsoft Excel for Office 365 MSO 32-bit

I'll preface this by saying that programming is not my strong suit but I would appreciate any help. I have used the below formula in an attempt to clear the contents of cell AQ when the value of cell ...
0
votes
1answer
48 views

Counting how often two different values appear with the same value in the neighbouring cell

I have an excel spreadsheet with one column for ingredients and one column for recipes. (see on the left in the picture below). I would like to create a matrix with all ingredients (as seen in the ...
0
votes
0answers
37 views

Excel 2016: VBA: Sort Grand Total by Largest to Smallest in Pivot Table

I managed to generate a Pivot table using VBA, but now not sure how to sort the "Grand Total" column on the right from Largest to Smallest using VBA that the pivot table generates. A little googling ...
0
votes
1answer
70 views

Excel 2016: VBA: Formula throws syntax error in a Macro

I have Excel data with column F that has date/time in the format: 11/13/2018 9:33:00 PM Now, I need to get that date displayed in column H as per the formula =TEXT(F2,("MMM-dd")) (I currently do this ...
0
votes
1answer
81 views

Transpose Stacked Data in One Column to Rows based on Variable Criteria and Unique Identifiers

Using Excel 2013 and I'm struggling to write a formula that allows me to transpose the amounts stacked in column E based on the deduction code in column F using various criteria on the first row/...
0
votes
1answer
34 views

How to filter according to a cell value using VBA?

I have two sheets in a workbook. I am using the following VBA code to filter the data: Sub apply_autofilter_across_worksheets() 'Updateby Extendoffice 20160623 Dim xWs As Worksheet On Error ...
1
vote
0answers
45 views

Filter charts on a dashboard to display charts that are on other worksheets in the same workbook [closed]

How to Filter charts on a dashboard to display charts that are on other worksheets in the same workbook? So I know you can create the charts behind each other and move them forwards and backwards. ...
0
votes
2answers
46 views

Repeating a list of cells in excel X number of times

I have a list of names in excel, For example Lizzy William Kate Charles I would like to use some VBA code (or other method to repeat this 12 times). I will be doing this over and over again and ...
0
votes
1answer
22 views

Splitting Workbook using filter and creating new file in column name

Suppose I have Workbook(Report.xlsx) and in that workbook I have different worksheet. In every sheet I have a column name B_Code. Using filter in B_Code I want a separate workbook with every sheet in ...
1
vote
2answers
93 views

SUM in word table with Variable cells

I have a table in the Word program like the following: By opening this table file, I have to increase or decrease the number of rows. So I can not use the formula for the sum of the seasons (Because ...
0
votes
0answers
44 views

Number of points per square in a grid

I have a scatter plot as the example below, and I was wondering whether there is a way to summarize all the points in a square of the grid with the number of points in each square? For example, the ...
0
votes
1answer
66 views

Excel - MyFitnessPal - Combine row data from Break/Lunch/Dinner/Snacks

I'd like to combine the nutrition data from multiple meals during a single day onto a single row. Current Sheet: Desired Result: My knowledge of Excel is limited, and non-existent in terms of VBA.
1
vote
1answer
34 views

How to include a double quotes mark into RegEx exclusion group in Excel UDF

With help of this Is there an Excel formula to identify special characters in a cell? VBA code and excel UDF, I am checking special characters in my csv file. Using this formula: =RegExCheck([@...
-1
votes
1answer
89 views

Excel VBA - Returning a list of values not found in one column

I want to get Excel VBA to return, in a messagebox prompt, all items which are in column A of worksheet Mastersheet but are not in column A of worksheet DeliverySheet. Having a lot of trouble ...
0
votes
4answers
82 views

Excel - Day and Date of Month

I have tried a few "Date" formulas but I cannot get this to work. Here is my issue: I want to set up a spreadsheet that will allow the user to type in A1 - the month and year. I would like my ...
1
vote
1answer
43 views

Compare excel worksheets

Here is the problem I have been trying to resolve all morning - I have two Excel worksheet files: Subset: This file has a subset of employees with various details including training status such as in-...
1
vote
3answers
46 views

Excel2016 vba Format function on Windows 10 produces unexpected time separator

Code below used to give requested time separator, but now Excel2016 on Windows 10 produces wrong result. Public Sub TestDateFormat() Dim s As String Dim d As Date d = Now() s = ...
0
votes
0answers
27 views

Unable to view macros or compile VBA project in Excel

I am unable to open a workbook that has macros on a particular computer. It will open on any other workstation. I have tried launching Excel in Safe mode and disabling macros with message and nothing ...
0
votes
1answer
32 views

Excel Vba function stops working on reopen

I was trying to set a vba function that changes the color of a hyperlink when it links to a non existing file. For that, I got the following code on a standard module. Function FileExist(path As ...
0
votes
1answer
18 views

Excel 2016 VBA Code for checkbox to enter yes or no up on selection from userform1

OK I'm new to this community and I have had great help from a number of users from other parts of this site. I posted a question yesterday and I haven't gotten any answer yet. I was browsing the site ...
0
votes
1answer
40 views

Protect cells from having data pasted into them, but allow manual entry of new data

Is it possible to protect a range of cells, so that a user can still type into them, but they cannot paste other cells over the top ? I have been through all the 'Protect Sheet' options, 'Protect ...
0
votes
0answers
19 views

PPTX with linked presentation slide objects - Source file changes name - How to automize the fix/update

I have created this "Master Presentation Deck" in powerpoint consisting mostly of linked powerpoint presentation slides from other presentations. The whole idea is that we need a master presentation ...
1
vote
1answer
33 views

Looking to loop a macro that I recorded, skipping rows and ending based on a condition

Apologies for the uninformed question but I've been looking into macros all morning to help me with a task I'm completing and I haven't found the answers that I need by searching google. I'm using ...
0
votes
0answers
54 views

Macro in excel error when pasting

I filter a column then I try to copy and paste the values. However, I get the error PasteSpecial Method of Range Class Failed Sub DD() ' ' DD Macro ' ' Rows("1:1").Select Selection....
0
votes
2answers
38 views

Macro/VBA to Add Text to Column if there is text present in another cell

I have a report that I download. It has varying Column A lengths. I'm looking to create a VBA/Macro that will put a certain text in M2 if there is any data present in the corresponding A cell. I don't ...
-1
votes
1answer
37 views

Macros disabled on Word

I don't know why my macros on word is suddenly disabled. I tried everything including placing the template location and my word docs as Trusted locations, Enabling all macros. It still won't run. Any ...
0
votes
1answer
65 views

Excel - Compare the value of two fields and change color depending on results

I am trying to compare two fields in an Excel Spreadsheet and if a number is higher then change the background of that cell and if it is lower change it also. For a further explanation I have created ...
0
votes
1answer
58 views

Need help for user form delete function

I am able to have the data deleted in my first sheet but it does not work the same for sheet 5. I am not hitting any error. How can i fix this? 'Delete Function' Private Sub Delete_Click() Row ...
0
votes
1answer
100 views

Creating a VBA loop to validate results of two nested functions across a range

I have been racking my brain trying to figure out how to nest a function inside a for each loop in order to run the same validation against each result and add it to a list if it meets the criteria. ...
0
votes
1answer
83 views

Cells property causes run time error '1004'

I keep getting the application defined or object defined error and the codes in ** gets highlighted. How can I fix this? Private Sub Update_Click() answer = MsgBox("Are you sure you want to update ...
1
vote
2answers
58 views

Showing part of an external sheet in a pop-up in Excel

I have two spreadsheets. The first has a table of numbers. The second has formatted text cells. When the user clicks on a cell in the first spreadsheet, I want to show a range of formatted cells ...
0
votes
0answers
45 views

Range Insert Assistance

I have been using the macro below for a while now but need to make one small addition and was wondering if someone could kindly assist. I need the info. in one cell to be moved when it has a 15 at the ...