Newest vba Questions

Q&A for professional and enthusiast programmers

I would like to have a macro in Outlook 2010 that will run a vbscript on my local drive

Here's what I've tried. strPath = "C:\Scripts\vba\gggg.vbs" Set objShell = CreateObject("WScript.Shell") objShell.Run Chr(34) & strPath & Chr(34), 1, True That did not work, any suggestions? ...

How to write a VBA function whose return value is recognized as a date by Excel?

I wrote the following test function in MS Excel 2002: Function someDate() As Date someDate = Now() End Function Then I use the function in a cell, like this =someDate(). But the value is shown ...

VBA HostExplorer Interaction

So i'm working with a new mainframe at my job and it's horrible. I don't need to get into specifics but whoever created it is a horrible human being... So for the past few weeks I've been coming up ...

Copy rows based on cell value and paste on a new sheet

Check This I need a help. I want to copy whole cell from A sheet name "Components" only if value in Column C is > 0 to a new Sheet name "Load list" Can someone please give me the macro code for this?...

VBA IE.document Click

The HTML code is as followed on a webpage. It's a link that I want to be able to click on from VBA. <a title="View Account Summary" class="unregLink" href="/Standard/AccountSummary/Pages/...

VBA - how to set empty cells in a range to zero

I am still new to Visual Basic, and would like to create a macro that essentially fills in empty cells with a value (integer) of zero, while leaving existing cells in the range as they were (if not ...

VBA UDF to find multi column criteria match using dynamic arrays

I posted a question in regards to finding a match with multi-column criteria. The provided answer works great. But I'm trying to make it a universal solution for my project, in terms of how many ...

Word VBA - getting text file output to look right

I'm not a VBA programmer but have been researching how to make a certain task easier. I've been able to figure out code to do 95% of what I need but now I'm stuck and don't know the correct keywords ...

VBA Code to copy specific header name columns and paste it another wb

I have code to select source wb and then copy ws to Main WB. I want to change code for selecting source wb & then ws, then code find special header name and copy entire specific columns data form ...

How to change row color base on the values in column 1?

I want to know how to change row color of a number of rows base on the value in column 1. Lets say in A1 to A5 I have the value "100" and A6 to A10 I have the value "150", i want to be able to change ...

Excel how to selectively pick and store values from a sheet

I have a sheet that contains a table of data with column names. What I need to be able to do is that to selectively pick a row and extract data according to its column names. For example what I would ...

Update Links in for Excel Spreadsheet Using Python

I am running simulations in Python that generate output that need to be directly consumed by a modeler in their excel workbooks. I have generated code that will directly output my data into their ...

Adding an external image as a full cover page for an excel PDF export, and solutions for horrible compressed image files

I've been creating a spreadsheet in excel to collate a number of statistics for a project, with the end goal of automating a report that can exported as a PDF document to share at board meetings etc ...

Need help to advice how to solve using Excel VBA

I have 2 tables as shown below Table 1 AA BB CC DD EE Table 2 bb aa bb1 bb2 cc1 cc2 cc3 I need help to do the below steps using Excel VBA ...

Unable to go deep for certain barriers in a multilayered webpage to fetch data

Hope you all are doing well. Recently working with some code i got stuck pulling specific data from a certain web. So far when i worked with sites i could notice that every documents are usually ...

How to add values in excel sheet through microsoft access and choosing specific sheet

I have an excel file with many different sheets. I was wondering how I can open the workbook, and input a value into a specific cell and choosing which sheet it goes in using visual basic (Microsoft ...

Excel table population, input from different tabs with output selected from max value of column

I have two sheets (Inputs and Spring Balance, Normal), one is a table of input values (dynamic, so the table grows) for the second to calculate. I would like to have the VBA program to sequentially ...

Pass two value to a sub routine

I'm trying to pass a target.value and target.address to my sub routine, but for some reason i'm getting error "Expected: =". Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address =...

VBA get dynamically names of component?

I am newbie in vb and I am trying to write simple programs in Excel 2010. I have a multipage with customers(cutomer1, customer2, ..., customer20) For each customer I have 10 users "labels" with their ...

Excel : How to list the values from a column the number of times written in the next column?

I have in column B some names, and in column C some numbers. I want in column D to have B printed C times: B : John | Bob | Steeve C : 4 | 0 | 2 D : John | John | John | John | Steeve | Steeve I ...

Split text in cells at commas

Let's assume a simple Excel spreadsheet with two columns A and B, where in the B column there are comma separated values. I need a VBA function to split these values each one in new rows starting from ...

run-time error '-2147417848 (80010108)':method 'add' of object 'listrows' failed'

When I execute the ADD button I get an error message: run-time error '-2147417848 (80010108)':method 'add' of object 'listrows' failed However, if I remove the "ListBox2" FORM it works fine. Any help ...

vba , Autofill userform from another workbook cell selection

I have a workbook that used to be one with many sheets, I have now split the sheet to different workbooks. The problem I now have is userform population from cell selection. When all the sheets were ...

How can I store the row and column numbers of a range in vba, and why am I getting a 438 runtime error?

I'm trying to capture the row and column numbers of a ranger in variables. After a fair amount of googling, it seems I might have to store these as Longs and not Integers, but not sure. Either way I ...

How can I send a range in the body of an email using a macro (mac)? (VBA)

I'm trying to send a range from a spreadsheet in the body of an email. Using excel 2011, OSX El Capitan and mac mail. Using http://www.rondebruin.nl/mac/macmail/macmail1.htm I can send the spreadsheet ...

How can I convert a range to a string (VBA)?

What is the best way to convert a range of cells to a string? I have a function that only takes a string as input so I need to convert the range to a string, while retaining as much of the formatting ...

VBA search for repeating single character using a Regex

So I've been learning VBA this past week and I have coded a database cleaning tool. However I am trying to Implement a clean that removes any signs of a repeating character. Specifically xxx, TTTTT, ...

MaskDuplicateTests From a different sheet VBA - Macro

I'm having trouble with my Macro. I need to to group record by "Patient ID" and combine their test based on a separate tab. I have created a tab called "TestNames" that has the following information....

Excel vba to search mail in outlook

I have below code to search a mail with specific subject in Outlook But Below code searched mail only in Inbox. But I want to search mail in all folder and subfolder. Also I wants to search latest ...

VBA to concatenate and then increment resulting value based on another value

I am trying to write a macro to loop through a spreadsheet, and on each row, concatenate three values (from different columns) into a single value (integer), and result that in another column on the ...

MS Access: Why am I getting an “Invalid use of property” error?

I'm getting the error in the title when using this code: Private Sub Command12_Click() Dim dbsCurrent As Database Set dbsCurrent = CurrentDb Dim query As QueryDef Dim sql As String ...

Using Option Buttons on a UserForm to place text in a range from the sub calling the UserForm

I apologize if this is posted elsewhere, but I am having issues understanding the relationship between the sub calling the user form and the user form controls. I have a sub that will populate data ...

SSIS export to Excel template - VLOOKUP

A client has an exact template that must be used. Due to the formatting I cannot insert the data directly into the template via SSIS. Idea: Run SSIS as a schedule. It copies the template and ...

how to identify an object property with iMacros

I writing an macro with vba (excel) and iMacros. When I record clicking in a field, this is the info I get: TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:gwt-uid-1317 the issue I'm having ...

Error with Dim, .Text = No error until startup, No text = Errors

So I am trying to find out why my code for Visual Basic is not working, I am trying to make it so it has two text boxes in a way merge, cause I need them separate for the text next to them and I was ...

VBA Code does not always save in desktop

I have a piece of code in most cases will save to the desktop, but sometimes when I am connected to the network, it will save into a network folder. I am keen for this to always save it in my desktop ...

Importing text files with the filename included

I initially wanted to setup a textbox where users can type in a date of a text file and click import(I created the from and did some coding but failed and could not find s upport for my issue). This ...

VBA - How to upload file to webpage?

I'm trying to fill in a form on a webpage using VBA. The webpage includes a button for uploading files (which opens a standard IE "Choose file to upload" dialog) and I would like to find a solution to ...

Worksheet Function in Excel Vba with concatenated values

I have the following formula: dim functionString as String functionString = "IFERROR(AND(MATCH(" & FirstName.Value & ",C2:C1048576, 0)>0, (MATCH(" & LastName.Value & ",B2:...

How to terminate RunOpenSolver in excel VBA

I am currently working on a DSS in excel VBA. At some point in my code I am calling RunOpenSolver in order to create a delivery schedule. This takes about 20 minutes so I would like to give the user ...

Transforming Yahoo Finance Currency XML in order to import into Access with XSLT

I am trying to create an XSLT file that I can use to properly import the Yahoo all currency feed at http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format. I want to eventually ...

Extract data from a website (frame) using VBA

I am looking for some method to extract data for all the Chapters from following website using VBA - http://portal.sw.nat.gov.tw/PPL/RedirectorNonLoginAction?appId=APGQ&privilegeId=GC451 Please, ...

creating charts with vba script

I am writing a script to create charts, one per line in my table. The idea is to get a line graph to show the history. the table looks like this: date modem capacity used 16/01/2017 PUT ...

How to create a dynamic list in VBA?

I have an excel sheet. I want to create a list which will be in 5 cells. For simplicity, lets call the items in the list as (item1, item2, item3, item4, item5). If I select "list1" from a cell-1, the ...

Can't open File Dialog Picker in VBA Excel Mac

Set objDialog = Application.FileDialog(msoFileDialogFilePicker) This fails on VBA on my MAC. I have the Microsoft Excel 14.0 Object Library selected in my references. Any ideas? I've searched the ...

Formulas wont update unless I go to another sheet and ask it to calculate even though all set to Auto recalc

And yes, everything is set to automatically recalculate. I change a value on one sheet and several cells return #VALUE until I go to a second sheet that it pulls those values from and hit any key ...

How to hide sheets in your excel file that are not filled in

I have an excel that hides certain sheets when opening the document. So like Private Sub Workbook_Open() Worksheets("screen_2").Visible = xlHidden Worksheets("screen_3").Visible = xlHidden ...

Excel Dynamic Formula/Reference Workbook

I'm trying to create a dynamic reference within a formula; meaning the referenced workbook and subsequent sheet name can be changed and the appropriate data loaded. I'm aware that a static formula ...

Excel formula returns #REF when linking to external worksheets and copied

I have a spreadsheet October2016.xls with formulas for external links to other sheets. When I copy the sheets to a different directory, I will get a #REF error. For example, I need to link to Assembly ...

I want to use values that are in macro in java program [on hold]

I want to use value of a function written in macro in my java function.Could you please help me out.
Translating... 0%