Tagged Questions
Visual Basic for Applications (VBA) is an event-driven, object-oriented programming language for writing macros, used for the entire Office suite. If your question is specifically about programming Excel, Access, Word or Outlook, also use the appropriate tag: excel-vba, access-vba, word-vba or ...
0
votes
0answers
6 views
parse colour from an image
if I have a heatmap like here
is there some way in R,python or VBA (or even in general) to parse the rgb colour codes of each cell of the heatmap from the image into an array/matrix? I know for ...
1
vote
0answers
7 views
split a value into two different variable
I thought I fixed a problem, but now I am facing another problem... VBA is so hard.
For i = 2 To LastRow
For j = 2 To LastCol
'
'*There is lots of code here....*
'
...
0
votes
0answers
5 views
MS Acess VBA with SQL backend merging transactions for multiple users
I have a MS Access 2003 VBA that I converted to run in Access 2007 with a SQL Server 2008R2 backend. The app is being used simultaneously to record transactions.
I have a weird glitch where if two ...
0
votes
0answers
5 views
Is it possible to assign Permissions to a worksheet by User or Station?
Not sure if this is even possible...
I know how to protect the entire sheet with VBA code but striking out otherwise. I've tried to implement the Excel "Allow Users to Edit Ranges" but will not work ...
0
votes
0answers
10 views
Converting lengthy Excel function to SQL?
IFERROR((SUMIFS('Sheet 1'!$K:$K,'Sheet 1'!$A:$A,'Sheet 2'!I$5,'Sheet 1'!$C:$C,'Sheet 2'!$B15,'Sheet 1'!$K:$K,"<>0"))/(SUMIFS('Sheet 1'!$J:$J,'Sheet 1'!$A:$A,'Sheet 2'!I$5,'Sheet 1'!$C:$C,'Sheet ...
0
votes
0answers
9 views
How to obtain the y-value from a chart when I know the x-value?
I have a scatter chart with smoothed lines. I know the x-values of the points where peaks are, and I want to know the y-values of the peaks at those points. I then want to assign that value to a cell ...
0
votes
1answer
11 views
VBA - How do I send new line command (\n) or tab command (\t) to a textbox.textrange.text of a PowerPointS Shape
SlideNumber = 1
Set oPPTSlide = oPPTFile.Slides(SlideNumber)
For y = 1 To oPPTSlide.Shapes.Count
MsgBox oPPTSlide.Shapes(y).Name
Next
With oPPTSlide.Shapes("Title 1")
...
-1
votes
0answers
30 views
How to return a double from a vba excel function?
Function test() As Double
If ThisWorkbook.Worksheets("A").Range(type) = "1" Then
test= 26#
ElseIf ThisWorkbook.Worksheets("A").Range(type) = "2" Then
test= 78#
End If
End ...
0
votes
1answer
10 views
Setting an array value results in an Argument not optional error in Visual Basic
I am trying to set the values of an array of Collections inside a For loop. However, when I go to run the program, it throws a compile error that states "Argument not optional" and highlights the part ...
-6
votes
0answers
32 views
How to convert a matlbab code to a VBA code
Can u please help me with the following code?
Augusto
Procedure: OX CROSSOVER (Order Crossover)
Step 1. Select a substring from one parent at random
Step 2. Produce a proto-child by copying the ...
0
votes
0answers
4 views
Microsoft Access Combo boxes and vba code 2007
I have two combo boxes each with different drop down items
Combo box 1: New, Sold, Retired
Combo box 2: Unallocated, Retired, Reworked, Shipped
I want it so when the user selects New or Retired ...
-2
votes
0answers
23 views
How to read individual strings from a comma delimited file in vb.net
I'm working on a basic program which is supposed to read a username and password separated by delimiter in a text file. Anyone who can assist me with a code that can read both strings in the file and ...
0
votes
3answers
28 views
VBA left function destination range is NOT populated
The left() function (not Leftsub()) is NOT populating the destination range. What am I doing wrong? Thank you!!!
Sub LeftSub()
Dim SourceRange As Range, DestinationRange As Range, i As Integer, ...
0
votes
2answers
30 views
Parse String to pull US State… but String may or may not contain city
I am looking to parse a string and take the state name from a field of data. Here is my issue: There is a comma and a city often times in the field, so I need to pull the state name that which is ...
-1
votes
1answer
17 views
Run time error 52 Bad file name or number
I am attempting to run vba code to perform a number of operations on a folder of excel files. This code had been written by someone else no longer with my company, but the macro worked when last run. ...
0
votes
0answers
16 views
How to connect excel to a table on a password protected website
I'd like connect an excel sheet to a password protected website that will automatically login(or prompt you to login) then pull table data. I've found a few questions like this but the problem I ...
-1
votes
2answers
20 views
Merge Rows with Same Column A
I am new to VBA and from what I have seen it will be the best way to go about doing what I want to do. I have an excel spreadsheet with Column A being the name of a company and Column B being the ...
0
votes
1answer
20 views
VBA For Each Loop only excutes once and then stops
I made a VBA macro that has the goal of doing several find and replaces on a database using a set of items in a table. I used a for each loop to try to iterate through each cell in the first column, ...
0
votes
1answer
24 views
Comparing two worksheets with different column order
I'm trying to compare two worksheets in excel to find new/updated records using vba.
(assume worksheet 1 is old, and worksheet 2 has the potential new/updated entries)
These sheets have very similar ...
0
votes
1answer
20 views
How to sortrows in VBA, instead of Matlab?
I have a question about sorting an array in VBA. Previously I programmed in Matlab and I would like to do something like: P = sortrows(P,3), but using VBA. That organizes a matrix by the 3 column.
Is ...
-1
votes
0answers
22 views
How to loop through files, copy from open file and paste to a single file?
This is my first time using Excel and I'm not a programmer. This code is from another post. I've been trying to replace the bold selection inside the loop with something that will select and sum the ...
-2
votes
0answers
28 views
Can a Windows macro interact with the window contents of an arbitrary desktop application?
I have a client who is running Windows and needs to run a macro or script that can automatically fill out a contact information form that sits in one of the windows of an arbitrary third-party desktop ...
-1
votes
0answers
17 views
Dynamically create variable names in VBA
I wan to dynamically create variable names such as: Matrix1Ver1, Matrix1Ver2, Matrix2Ver1 and Matrix2Ver2. So the numbers 1 and 2 varies whereas 'Matrix' and 'Ver' remains fixed. I could write the ...
0
votes
0answers
11 views
Excel Workbook opening issue using VBA
I have a VBA application and I need to deal with these 3 cases:
(1) When I double click in a .xla file from Windows Explorer
(2) When I click in the Excel button icon from Start Menu
(3) When I ...
-1
votes
0answers
10 views
Take data from a specific site with search
Take data from a specific site with search
I am new in VBA and i am trying to find a way to take some results of a specific search in the web site to my Excel.
I have to two problems. First I can't ...
1
vote
0answers
5 views
Check for the font color of the powerpoint table when a certain style is selected
I have some tables with different table styling, option that you can select on the table design. I need to get the font color of each element of the table. For that I am using the following peace of ...
1
vote
1answer
19 views
Is it possible to insert text boxes/labels into a chart using vba?
I'm currently writing a program that will graph an x-ray spectrum, and then calculate where all of the peaks are, and what they should be labeled. However, I'm not sure how I can add the labels of ...
0
votes
1answer
13 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 ...
0
votes
0answers
24 views
Simple text coding/decoding Excel VBA
I have made nice macro that will send login details to API which will return as response security string that is used for sending further commands to API and executing them.
I am a bit worried about ...
1
vote
1answer
22 views
application.run vba not working with sheet macros
My file has different sheets with the same-named sub routine inside each doing different things specific to the sheet. So, I'm trying to call dynamically a macro inside a selected sheet using ...
0
votes
0answers
4 views
Simplest way to create custom toolbar in CorelDRAW X6
I want to add a new toolbar on the shape properties pane (shown in the attached image!). I see there are two ways to create addon for Corel: in Visual Basic with macros, and in C# with VSTA.
I see on ...
-1
votes
2answers
15 views
Loops with advanced filter, new criteria every Loop
I have this code:
Sub omgifthisworks()
Sheets("data").Select
Columns("A:A").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Sheets("log").Range("A1:A4"), Unique:=False
...
1
vote
2answers
17 views
Excel - Count Unique String Variants
There could be quite a simple solution to this, but I am trying to find the number of times a unique variant (i.e. non-duplicates) of a string appears in a column. However this string is only part of ...
0
votes
2answers
14 views
VBA access run sql check row count
I'm trying to display a field on a form depending on the results of an sql query. Since I don't know vba in access I'm struggling and don't know where I am going wrong. Help will be greatly ...
1
vote
3answers
36 views
How do I find a value in a row and return the column number with VBA?
My excel sheet is filled with zeroes except for one cell in every row.
I want to find that cell and return the column.
For example: In the cell T616 is a value other than 0. May it be -15400.
I want ...
1
vote
2answers
22 views
Add formula to range using VBA
I would like to add a formula to the to a range of cells. It should multiply the a neighbor cell by 100. Therfore I tried the following:
Range(Cells(row, col + 17), Cells(row + num_positions, col + ...
1
vote
1answer
9 views
Excel VBA - Paste into Find Command
This is my first time asking a question on stackoverflow (but I've found a lot of super helpful information here before!)
I'm trying to create a macro which searches for a string of text that has ...
-1
votes
0answers
12 views
Excel macro - two sheets copy entire row to third sheet if column matched
I've two sheets (order + list of all products with description) which I need to match by one column (product code, C in 1st, N in 2nd) and those rows wicho match I need to copy entire row from the ...
0
votes
0answers
9 views
TransformXML in VBA removes Encoding
So having got much help of here, which im thoroughly thankful for!
I have worked out how to export and apply XSLT to the exporting file from MS Access,
But now when i transform the file throught ...
0
votes
1answer
25 views
VBA Copy and Paste to new Worksheet
The following code basically copies and pastes from Sheet1 to Sheet2 in the same order it was in on Sheet2. I need it to paste the values into the same column on Sheet2 so I can run a sort for all of ...
2
votes
1answer
15 views
VBA excel equation that continues down the column
I am trying to write an equation that varies down the column, the general equation is the same.
I.e. There is Column A, B and C, with the equation displaying results in Column C.
The general equation ...
0
votes
0answers
17 views
VB script to import email data into a database?
Hi i am trying to get my VB script to connect to the access database and export some email data into it.
does anyone know the best way to go around to do this. At the moment it creates a txt file ...
2
votes
0answers
21 views
Create excel macro to compare en select data
I am new to macros so i dont know how to write one, but i think i have to use one to do what want on excel
I have two sheets (Datachart and Datapivottabel)
the datachart sheet contains (in column ...
0
votes
1answer
15 views
Access to a parameter in another class
Hi friends I have a class in vba, in which I have defined a parameter like this:
Public lcl As Boolean
At the first I am setting this parameter in this block:
If MsgBox("Lokal ?", vbYesNo, ...
1
vote
1answer
22 views
SQL Query between dates in VBA
I've a problem making a sql query in VBA using excel and an access database. In mi VBA code I've two data variables with this content:
DateMin = 31/07/2014 22:00:00
DateMax = 01/08/2014 06:00:00
...
0
votes
0answers
29 views
VBA Type mismatch when deleting a row
Using Excel 2010, VBA purpose is to move rows which are marked as 'complete' in column H into a different worksheet (before this, it stamps them with a complete date etc). I'm using the ...
-2
votes
1answer
27 views
Delete All VBA code on the sheet before sending it via e-mail
I have this code that extracts only the active sheet and send it to specific email.
I have a 6 CommandButtons on that sheet which are attached to some codes.
So I need to implement some code in ...
2
votes
4answers
42 views
VBA - Range.Row.Count
I have written a simple code to illustrate my predicament.
Sub test()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sheet1")
Dim k As Long
k = sh.Range("A1", ...
0
votes
1answer
26 views
VB script saves a incoming message as *.msg type. Will this save the entire body as welll within that?
Hi i have a VB script but I can not test it at the moment. Does anyone know if the VB script brings the body of the message automatically within the .msg file without defining it in the script?
Here ...
0
votes
0answers
18 views
VBA Excel Cell comparing and row comparing
Regarding this question : VBA Excel : Delete excel row
I would like after deleting identical rows to have :
Column B Column C
John 4000,3201
I tried in a way to store the last ...