Use Stack Overflow for Teams at work to find answers in a private and secure environment. Get your first 10 users free. .

Questions tagged [vba]

Visual Basic for Applications (VBA) is an event-driven, object-oriented programming language for writing macros, used for the entire Office suite as well as other applications. VBA is not equivalent to VB.NET, or VBS; if you're working in Visual Studio use [vb.net]. If your question is specifically about programming any MS Office application, also use the appropriate tag: [excel], [ms-access], [ms-word], [outlook], or [ms-project].

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

How to exit a macro where the current sheet grand total = 0 (no values picked up in the pivot table)

I've recorder a VBA Macro which works well and does what I want, however the issue is when there isn't any values the Macro Breaks and doesn't work, is there anyway to check the current sheet's pivot ...
0
votes
1answer
13 views

Insert Rows - looping macro function - based on number in cell

Newbie with macros/vba here. I have a template with two buttons - one copies and pastes the sheet into a new tab, the second will add rows based on a Command button from manual input Is there anyway ...
0
votes
1answer
24 views

How to add different data into a range of cells

I am very very new to vba coding and I apologize if I am ignorant to some issues but the following program is something I have come up with to check the range if there is 2 empty rows in a row and if ...
-1
votes
0answers
18 views

Trying to make a macro that will fill in a cell with data from another workbook if 3 cells in this workbook match 3 other cells in that workbook

Tried an if statement. eventually i want to expand this into a loop but the cells are a bit all over and i would be happy if I got a piece of working code for this. Thanks! This code is the summery ...
0
votes
1answer
25 views

Array w/Nested For Loop

I was doing a project earlier that consisted of many index/matches. I personally love nested loops, so I wanted to see if I could implement it this time around. My nested loop consists of i and j, ...
0
votes
0answers
13 views

VBA to copy a range from XL and paste “Keep Text Only” in PPT

I have a range of cells with strings that I'd like to copy and paste into a pre-formatted text that's named in PPT. I'd like to paste it as "Keep Text Only" I know I can do it manually, but for the ...
-1
votes
1answer
19 views

VBA EXCEL Macro code execution interruption using a Column reorder Array

I'm using the following coding for column re-ordering Dim search As Range Dim cnt As Integer Dim colOrdr As Variant Dim indx As Integer colOrdr = Array("fullDt", "branchName", "mediumDesc", "...
0
votes
0answers
9 views

VBA Powerpoint on Mac error when combining presentations with ActivePresentation.Slides.InsertFromFile

The goal of my effort is to have a VBA macro that will consolidate a number of PPT presentations into a single PPT presentation. The component presentations that are to be combined are in a number of ...
0
votes
1answer
19 views

Problem with AddFromString function of CodeModule in VBA

I try to add code to VBA CodeModule using the AddFromString function of VBComponents CodeModule. However there is always a extra "()" added to the code if the string I add involve lib and _(line ...
-1
votes
0answers
14 views

Alphabetizing Node.text before adding to form control

Several years ago, a consultant set up word documents with userforms that pull information off of an XML service. The XML service provides us data from a sql database. As we have modified the system,...
0
votes
0answers
22 views

How to code a multiple solver macro in vba?

I hope you can help me with this one. I am trying to run multiple solvers across different columns and the same row of a worksheet. First, I put some If statements to define the range of cells that ...
-1
votes
0answers
18 views

the correct format to set the parameters of chart title?

set up the chart title, get the error "the object is no longer valid" .HasTitle = True With .ChartTitle .Text = ActiveWorkbook.ActiveSheet.Cells(5, 8) .Font.Name = "Tahoma" ...
0
votes
0answers
26 views

Need to click buttons and get information from textbox in HTML with VBA

I want to webscrap the following website: https://appscvsmovil.supercias.gob.ec/portaldeinformacion/consulta_cia_menu.zul?expediente=87379&tipo=1 Where "expediente=87379" will always have a ...
0
votes
1answer
20 views

How to embeed a couple of pictures in an Outlook Email on Excel VBA macro

I need to embeed 2 pics in the email body (it doesn't matter if I attach them too, but I need to embeed them). I've researched and found kind of what you see below, however those i found were for only ...
1
vote
1answer
34 views

How to pull JSON values into Excel sheet

I am trying to pull JSON values from a URL that I am working with at the moment. I may have done something like this before but I dont know what I'm missing here. Here is the URL - https://eu-...
0
votes
2answers
53 views

VBA: Identify Last row of formulas (or data) in sheet, copy that row, and then paste one row right below it

I would like to identify the last row of formulas on the sheet titled "Term Loans". I'd then like to copy all those formulas and paste them one row below. For example, if the last row with formulas ...
0
votes
1answer
41 views

Making worksheet VBA function for workbook

I'm trying to put the VBA in the workbook object rather then each sheet but am not having any luck. I'm thinking I need to use Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As ...
0
votes
0answers
19 views

How to extract Cipher Data into excel

I am trying to extract Data from URL.. there are some contact and mobile number in Cipher.. its look like Icone... I want to extract that numbers also there are one whatsapp link. i think its hidden ...
-1
votes
0answers
22 views

Check internet connection with vba excel

I have proof I am doing scraped web, and at the moment I disconnect my internet, I would like to have the forced closure of my app, I can not achieve it, since the app throws me the following error. ...
0
votes
1answer
14 views

Excel Combo Box Drop Down (form control) non functional when Protected

EDIT: Should've researched further. This solved it: https://excel.tips.net/T002691_Selecting_Combo_Boxes_in_Locked_Worksheets.html Simply unlock the cell associated with combo box (right click, ...
0
votes
1answer
29 views

Clicking on a Link via Excel VBA - getElementsByTagName doesn't work

I've seen this manner of excel VBA before, but unfortunately, it doesn't seem to work for me. I'm using Excel 2016, and I'm trying to navigate to an internal website and click on a link to start ...
0
votes
0answers
16 views

How do I transfer text from multiple forms in Word to Excel using VBA?

I know this question has been posted in several places, and I have tried everything I can think of to make it work...but I can't. I want to transfer my forms from Word to Excel using VBA. Everytime I ...
-1
votes
0answers
23 views

Excel - provided link shows the site is under maintenance [on hold]

I'm trying to create a macro to get data from a website. I tried to macro record but when I enter the link on the getting data from external web, I got "Under Maintenance" error on the site. I tried ...
0
votes
0answers
23 views

VBa and Excel :find match of two tables with different date format in the same sheet i

I am learning excel and VBA and I force with following troubles: In this case I would like to compare(find match)in two tables, such as item number and date which is in different format and my code is ...
0
votes
1answer
32 views

VBA: Function that will find the sheet name with the highest number of all the sheet names

Assume there is a workbook with seven sheets, and the sheet names are as follows: "Terms" "Revolvers" "15" "22" "55" "59" "146" I need VBA code that will identify the highest numbered sheet ...
1
vote
1answer
37 views

.EntireRow.Delete Not Working in Excel VBA

I am trying to use macros to delete filtered rows from a table in Excel. I Keep on running into issues with it deleting the data (Error #1004). Here is my code: Dim RangeToDelete As Range Set ...
-2
votes
0answers
29 views

How to import a CSV file into outlook 2020 calendar [on hold]

At work I run a query to get data about incoming events, and data comes in an excel file. From that, I can sort and filter the data, until arriving to a CSV file with what I want to add to my calendar....
0
votes
1answer
42 views

Excel VBA code, formula and function, not working as expected

I have an excel formula I have used: =IFNA(LEFT(INDIRECT(ADDRESS(3,MATCH("Target Ship*",Ed!1:1,0),,,"Ed")), FIND(" ",INDIRECT(ADDRESS(3,MATCH("Target Ship*",Ed!1:1,0),,,"Ed")))-1),"") I am trying ...
0
votes
1answer
28 views

Reposition shape and text box on a slide

I want to achieve when I select either a shape or a text box they will move to the same location (bottom align) on a slide. My shape and text box are different in height so for example with text boxes,...
0
votes
0answers
42 views

Need help on sorting out multiple codes

I need help with the VBA code. I need to copy rows(A2: A4) and paste all the three rows from A5 and so on using the input box(max 200 times). I need to hide all the 600 rows and need to unhide only ...
0
votes
1answer
28 views

VBA / Internet Explorer: Capture Resulting URL From OnClick Event

I am automating some data collection using the Internet Explorer object in VBA, and have hit a wall trying to obtain a url resulting from a href onclick event. The link is being "clicked" by the code ...
0
votes
1answer
21 views

How to protect a worksheet and unprotect a list object in vba (extended to deleting and adding rows)

Allowing a user to update the content of listobjects in protected sheets can be cumbersome. Gladly I found Excel Developers answer but I also needed to allow the user to add or delete rows. Below is ...
0
votes
1answer
36 views

How to Copy and Append filtered data sourced from multiple sheets into a single destination sheet using a loop?

EDIT: I've pasted some revised code below in the Sub(Copyinternal) section. Still doesn't work but maybe I'm on the right track? I have a workbook with 6 tabs. Sheets are set up as follows: ...
0
votes
0answers
41 views

How do I timestamp on Ms Excel for different entries at each respective designated column?

I have a table with five columns (titled movements A,B,C etc). I want each cell of payments locked when a value/amount is added so its not delete-able (this part is working fine) But i also want to ...
0
votes
0answers
42 views

Resume macros/vba behaviour after once stopped

I am building a excel sheet with some few programming on _Activate, _Change, _SelectionChange, etc... as I am developing, I put breakpoints in vba, after once the code is stopped, VBa doesn't come ...
0
votes
0answers
18 views

How to iterate through some shapes in visio?

I'd like to iterate through some shapes in Visio, I have a solution that works but which is a bit low because there are a lot of shapes (a thousand maybe and I'm only interested to iterate on twenty ...
0
votes
1answer
18 views

Macro/VBA for how to filter all of “string” out of a pivot table

I am trying to filter out all rows that include this string "PRC" out of my pivot table. I was doing this by recording a macro, but when I made the keystrokes, I got the code below that (in the macro ...
2
votes
0answers
39 views

How can I parse through an HTML body to get table data?

I'm new here and apologize if this question is too simple for most here. I am using Excel VBA to open a specific email, find the information on a table I need, and send that information back to my ...
0
votes
0answers
28 views

Excel VBA printing too many copies

I have a macro that formats a page and then prints it based on user input as below: Dim printAnswer As String printAnswer = MsgBox("Print form?", vbQuestion + vbYesNo) If printAnswer = ...
0
votes
1answer
21 views

VB search multiple excel sheets

I am trying to write this VB code to do a quick search for data but only searches one sheet. I am trying to figure out how I can modify my code to search the whole workbook but have come up short. I ...
0
votes
1answer
34 views

Why do I keep getting error in list box multiple selection

I am setting up a multi-selection box - using a script I found online, my VBA is pretty much nil. I keep getting next without for error Private Sub CommandButton2_Click() myVAR = "" For x = ...
1
vote
2answers
24 views

expression.Name.Name Error 1004 Excel VBA 2016

The problem is that I want the property Name.Name of the Target range in the Change event as the following Code show Private Sub Worksheet_Change(ByVal Target As Range) If Left(Target.Name.Name, ...
0
votes
2answers
48 views

Is there a way to use different pre defined arrays each time in a loop

I have a sub I got from the web that will arrange the sheet columns in a predefined way. It works for a single sheet but now I have an application where I need to reorder 4 sheets, each in different ...
-12
votes
0answers
39 views

How do I insert vbscript in VBA (Macro) [on hold]

I have vbscript code.. I'm looking for a way to execute it (insert in) from vba macro in word, please help.
0
votes
1answer
14 views

Changing font of text in object pasted into PP using VBA in Excel (Table as Table in PP)

Problem: unable to change font of table pasted into power point. I am copying a table (section of spreadsheet) into a powerpointslide (Layout is Title Only) I need to be able to change the text in the ...
0
votes
0answers
23 views

Can't run procedure on a different worksheet [duplicate]

The procedure I am attempting to run, which calls a dynamic range within a specific worksheet, will not execute if I have another worksheet selected in the workbook when the procedure is run. The ...
0
votes
0answers
22 views

LoadPicture method failing

I have successfully loaded an image into Oracle table. When I try to retrieve the same image to an image control in VBA, the LoadPicture method is failing. Here is the code I used. Private ...
0
votes
1answer
20 views

How to copy a specific amount of rows from one ss to another

I have 2 main ss accNo and output. I'm trying to copy x amount of rows from AccNo to output. The x is a variable and is determined by the user, it's inputted into cell B5 from a different ss called '...
1
vote
1answer
19 views

Parse a word docx file to copy a specific heading paragraph into an xlsx excel file

Would you please help me to select the whole paragraph beneath a given heading in a word file and import its content to an excel file through VBA? The heading is always named 'Notes' in the word file ...
0
votes
1answer
14 views

Hide or unhide sheet depending on multiple cell value

For work I'm trying to figure out how I can make a macro in excel to unhide sheets when you type a specific word in a column. I'm totally new to this so it's a big search. So far I got this: Private ...