EXCEL-VBA (Visual Basic for Applications for MS-Excel) is the dominant programming language for Microsoft Office Excel.
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
8 views
ScreenUpdating = False not working
I know there are lots of threads relating to this topic, like don't use "Select" or "Activate" or set it to false if you need to use it. I set it to False every time I use "select" or "activate", but ...
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
Select dynamic range without header
I want to select all rows in the range A2:BG2 if there are data present in column B. Row 2 is a header.
This almost works:
Set rng = Range("A2:BG2").Resize(Cells(Rows.Count, "B").End(xlUp).Row)
...
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 ...
-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
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, ...
-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 ...
1
vote
1answer
14 views
Excel writing formula via VBA
do you know how to write this type of Formula in Excel Cell via VBA:
Range("e15").Value = "=SUM(OFFSET(E6:E7;0;0))"
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
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 ...
-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 ...
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 + ...
0
votes
1answer
7 views
How to assign multiple listbox values to one variable and put those in Email “TO” field
I am trying to be able to select multiple values in two listboxes and assign to two separate variables. I want to then take those variables containing the selections and generate an email with the ...
-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
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 ...
1
vote
1answer
8 views
Copy range from sheet overwrites data
I am writing a macro to copy a range from multiple sheets (within the same workbook) to a column in a new sheet in the workbook. I would like values in the range ("C2:C12021") from the first sheet to ...
0
votes
1answer
13 views
Excel Macro run time error
I am trying to run a very simple macro that deletes a number of columns from a work book, but when I run it I get the error Run-Time error "1004": Application-Defined or object defined error.
Dim y ...
0
votes
0answers
14 views
How to send email on failure to unlock a password protected excel sheet
I have a password protected excel sheet.
I just want to know if it is possible or not... that if someone tried to open that sheet three times with wrong password, an email will be triggered in my ...
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
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 ...
0
votes
0answers
20 views
fill specific cells in second column - vba excel
This is my code:
Sub fillcells()
Dim rngA As Range
Dim arrayFinal As Variant
Dim i As Long
For Each rngA In ...
0
votes
1answer
12 views
Using Find Function to return cell addresss
I am using the find function to search through a number of different ranges for a specific heading.
If this heading is present I would then like to extract the information from the cell below. Is it ...
0
votes
1answer
22 views
deviding an even and an uneven number
I am very happy to discoverd this site. I get very good help. Hope you guys can help me with another problem. I want to round a number. Lets say I have a number 39 if I devide this into 2 then I get ...
0
votes
1answer
20 views
How read certain XML data into Excel via VBA
I got a XML response text from Google Map Distance Matrix API that I have to read it into Excel or message out certain information from the XML response text. I will just need the Value in ...
1
vote
1answer
23 views
Create Graphs automatically out of the excel generated via SSIS ?
I have the following requirement,
A SQL server 2008 scheduled job that runs at 9 am in the morning. This job should send a spreadsheet with data in a workbook(workbook1) and the chart attached in the ...
1
vote
2answers
28 views
VBA Excel : Delete excel row
I have a an excel file which looks like this :
Collumn B Collumn C
John 4000
John 4000
John 4000
John 3201
I want to delete ...
-5
votes
0answers
33 views
Excel VBA needs to sum similar rows based on 2 cells [on hold]
This is part of program for material acounting from the point of the warehouse view, in a Company. Each sheet(there are all the same) represents one article and it(sheet) contain all ...
0
votes
1answer
20 views
VBA Code interupts when I use workbooks.add(template)
I'm trying to create a new workbook as a template of existing Excel file and faced with some difficulties. Everything is ok until this sting perfoms:
Set wkb = Workbooks.Add(Path & FileName)
'do ...
-1
votes
0answers
17 views
Every 15 minutes open high low close volume data in same sheet in excel
A B C D E F
Date Open High Low Close Volume
31.07.2014 10:05 202.2 202.7 190 225 2552550
31.07.2014 10:00 202.9 ...
0
votes
1answer
25 views
How to extract pieces of data from website with VBA Excel
I read some example code to extract the data from Website using VBA in Excel, like this one for example Stackoverflow's Example. I understand some but I cannot find how to adapt into my problem.
...
0
votes
1answer
24 views
VBA Code for Excel VBA Lookup based on multiple inputs(partial)
My Excel Sheet format is similar to this
Name code1 Name Code2 Name Number Input1 Input2
AB XY GSABPEXY1 110 BA BC
BC BA GSBCPEBA1 ...
-3
votes
1answer
10 views
Compare and arrange data
I have two data: Data A and Data B. I am required to arrange them using VBA
Data A |Data B
-----------------------
10.36 |10.36
151-92123 |18.126
155-04472 |143-00004
155-06313 ...
1
vote
1answer
22 views
Considering Space Character as Empty Field for PivotTable
I'm dynamically creating a PivotTable using VBA. I would like to count the number of non-zero entries from my source data, but instead of blank cells, my source data have space characters (" ").
I ...
0
votes
2answers
29 views
VBA Flatten Hierarchical array
I have a hierarchical array that I want to flatten so that it will be easier to iterate through.
What's the best way to flatten a hierarchical array in VBA?
Visual of hierarchical array:
s
p
...
0
votes
2answers
37 views
Find and Replace and Looping Though a Table
I am trying to make a user friendly excel interface to replace values in a large data set using vba.
I have a small table with the Columns "Replace What" and "Replace With" and the large data set in ...
1
vote
1answer
25 views
Only user -defined type defined in pubic object modules can be coerced when trying to call an external VBA function
I am trying to call an Access function from Excel and get this error:
"Compile Error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to ...
0
votes
1answer
24 views
For each cell in Excel find in Microsoft Word
I am an amature at VBA. I have a list of 400 part numbers in Excel in Column A. I also have a Word document with 30 tables, and each table is 4 columns wide. The 4th column is a boolean value. I want ...
0
votes
1answer
20 views
determine colour of bars in vba
is there a possibility in VBA to control the colour of each individual 3D bar in a 3D histogram (such as here)
I would like to pass it a colour matrix with as many entries as there are bars ...