Questions tagged [worksheet-function]
A worksheet function is represented by a keyword in an Excel formula that performs some action on input and returns output to the calling procedure, either a worksheet cell or another function.
1,322
questions
0
votes
1
answer
25
views
WorksheetFunction.Sum with For loop
Hi! I'm posting this question in the hope it hasn't already been answered!
As you can see in the image, I would like to get the area under the curve using VBA. The results of the trapezoid method ...
1
vote
1
answer
29
views
Run-Time Error 1004 Accessing Worksheet Function in VBA with Error Handling
The code provided below is intended to highlight cells where a negative word is within 4 words of a key word. For the sake of my benefactors privacy I will not provide the keywords I search for ...
0
votes
1
answer
33
views
Check sheets name based on a range, if sheet not found then create new sheet with name from range
I have a workbook with currently two sheets MI and Validation. Validation sheet column two have names, I need a code which should run ok opening the file and check if sheets are already created with ...
-1
votes
1
answer
33
views
How do I get it to select a single row based on the value?
I'm working on simplifying an excel worksheet and I want information in the rows to be transferred based on the value. If the value = "done", I want it transferred to Carc. If the value = &...
0
votes
0
answers
40
views
Find the areas near my point based in coordinates - excel
There are a few areas, each with its own value, i enter with a lat and long that i want to know in which area it is and give the value for that area. So far, so good. Found how to find where my lat ...
-1
votes
1
answer
44
views
Make columns and rows mandatory
i need to make rows and columns mandatory before close
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim lr As Long
Dim r As Long
' Activate correct sheet
' Sheets("Sheet1&...
0
votes
0
answers
18
views
Array function (UDF) only sets first cell in a row
I need to output to multiple cells in a row from an UDF and I tried this solution:
https://stackoverflow.com/a/43669306/90800
Function tester()
tester = Array("a", "b", "c&...
0
votes
0
answers
14
views
Get cell value in Excel VBA user definited function returns "#VALUE!" when Dim is used
I'm trying to get the value of a cell that's left to the calling cell of a user defined function in Excel.
This works:
Public Function DisplayCaller() As String
Application.Volatile
Row = ...
1
vote
1
answer
159
views
Save an embedded file to a location (export file from excel) with VBA
I have a little macro, that opens a Form where you can input details,
when you click on a button, you create a list with all the entries and save a selected pdf file thats embedded on another ...
0
votes
1
answer
42
views
Apply SUMIF - multiple criteria from dynamic sheet name
I have been making a VBA for applying worksheetfunction.sumif.
The goal is to:
sumif multiple criteria
sumif values from other sheets
sumif result shown in a "report" sheet.
I got to a ...
0
votes
0
answers
89
views
unique combination (using WorksheetFunction.Unique)
I'm trying to get a list of unique combinations, taking the first two characters from column A and concatenating it from column B:
Col A
Col B
aa-jhg
alfa
aa-khj
beta
ab-ztu
alfa
aa-ztu
alfa
...
0
votes
0
answers
68
views
How to get the count of no of rows in multiple sheets of a workbook seperately?
I have 9 sheets in a workbook and in 10th sheet i created a column (say A) in which name of all the 9 sheets is mentioned.I applied the formula =CountMyRows(A2)-1 it returned the value of no of rows ...
1
vote
0
answers
26
views
get conditional lastrow value
here I have serial number in textbox (txt_Rec) from worksheet("Sale") lastrow.
Now i want to get conditional values in textbox (txt_Rec), if i select "Sale" from combobox(Me....
2
votes
2
answers
161
views
How to return text based on the max value on another column
I have a table that contains multiple ID & products.
In cell F2 & F3, I would like to return the product based on the max value (largest sales in column C).
Is there any Excel function I can ...
0
votes
2
answers
93
views
Google Sheets - Identify Duplicate Cells and Replace Cell Value App Script
Is there a way to identify duplicate cells and replace the duplicate's cell value to blank or clear it but not the entire row, only one column value. In my example below. I want to identify duplicates ...
0
votes
1
answer
27
views
Copy Iteration Issue
The script below triggers every couple milliseconds due to the Worksheet Calculate event and then copies from my Pivot Table to the Chart Helper. Script works great but when it copies the next ...
0
votes
1
answer
42
views
how to put a really long formula's result into a cell using application.worksheetfunction
I'm looking to add this formula (and a few others) to a tool I'm creating.
=IFERROR(INDEX('TO Pick'!A:Z,MATCH(Historic!M6,'TO Pick'!E:E,0),13)+INDEX(Pick!A:Z,MATCH(Historic!M6,Pick!E:E,0),13),"&...
0
votes
1
answer
45
views
Worksheet_Change cannot work on cells updated by formula
I would like to call a macro if the values of the cells in column 30 change, and all the cells in column 30 has input like '=A1-C1' (formula format). In this case, the Worksheet_Change will not work, ...
0
votes
1
answer
41
views
Trying to use boolean logic within Application.WorksheetFunction.MATCH and getting Type Mismatch error
I have a worksheet function that is working perfectly fine in the worksheet, however, when I try to reproduce it in a macro I am receiving a Runtime Error 13 Type Mismatch. The function in the ...
-1
votes
2
answers
62
views
Is it possible to run worksheet functions on arrays rather than cell ranges?
For example, instead of finding standard deviation for the range of cells in the example below, is it possible to apply this same function to the elements of an array?
I could copy all the array ...
1
vote
2
answers
56
views
Is there a VBA worksheet function that will allow me to do a two layer search?
Is there any formula that I can use to make a double-layer search?
I want to be able to gather whatever information on the third column that meets two criteria.
It has to be one location (in this ...
0
votes
0
answers
27
views
Sum table values by both column header title and by date criteria row by row using Application.worksheetfunction.SumProduct
I've a table with multiple columns and multiple rows and i've created a code to sum table values by three criteria ( by column header title - by dates >= lower date - by dates <= upper date ) ...
0
votes
0
answers
27
views
How to find last empty row among many named ranges in worksheet and push the textbox value for selected named range without showing worksheet
off late I got developed interest in excel VB applications and practicing it since last 2 years. ( I use Excel 2016 version )
I have a problem with my recent Vb program. I have designed a main ...
4
votes
3
answers
75
views
Delete every second worksheet starting with the first (so 1, 3, 5...)
I am currently using a VBA code from Kutools that lets me combine all my worksheets into one combined "Master" sheet. However, every relevant worksheet is preceded by an irrelevant one that ...
0
votes
1
answer
128
views
Using VBA's onboard sort function
I want to sort an array and since I am lazy I wanted to use the onboard sort function of EXCEL/VBA.
According to the official MS Office support worksheetfunctions.sort should also be working with ...
0
votes
1
answer
38
views
How do you find the row a value entered from inputbox is in, and then use it to define .select data range?
I am having trouble getting the following block of code to perform. I keep getting the 400 error and am very new to this. Any suggestions based on the code below would be highly appreciated. I have ...
2
votes
1
answer
96
views
How to find median of values within the same group?
Median help
Hi there, I'm trying to find the median of the values (Price) that share the same group (Quarter) as in the picture I have included. I have colour-coded them to show their corresponding ...
2
votes
1
answer
40
views
Excel - Identify if Worksheet exists between two worksheets?
I have 5 worksheets: (1) Summary (2) 2020 (3) 2019 (4) 2018 (5) 2017
In my "Summary" worksheet, I have Column A with cells each containing the name of each worksheet (A1: 2020, A2: 2019, A3: ...
0
votes
1
answer
87
views
Check column and if condition is True send an email
In the code below I need to check two columns. Column "N" and "O". If I enter an "X" in column O2:O801 I check to make sure there is not an "X" in column N2:...
0
votes
1
answer
88
views
why do I get object doesn't support this property or method?
for some reason
MsgBox (VarType(Application.WorksheetFunction.Address(1, getRowOfTestCode, 4, 1)))
where getRowOfTestCode = 13
throws the
error 438 "object doesn't support this property or ...
1
vote
1
answer
443
views
Excel Formula to compare single cell value with the whole column and return the value for a particular row where match found
I need to compare the B2 Cell value (6012469) with Column A i.e. cell A2 to A10 and return the b2 cell value (6012469) in column C where the value matches i.e. cell C5,C7, C9 AND C10 and NA in ...
1
vote
1
answer
68
views
How to fix code to save all worksheets as one PDF? VBA
'How to fix code to save all worksheets as one PDF from the open workbook? VBA. It only prints the active worksheet right now for some reason.
Sub abc()
For i = 1 To Workbook.Worksheets.Count
With ...
0
votes
1
answer
96
views
Copy/Paste to Next Row
My Worksheet_Calculate event works well. However when it pastes it finds the next open row on sht2 then once the event is trigger again it re-pastes over the original row it pasted the first time. ...
1
vote
1
answer
101
views
Copy/Paste Data Log Based on a Condition
The following code copies a row of data from a Dashboard to a Data_Log as you repeatedly click the Start button. I am trying to add a condition that each time a Yes appears in column D of the Time Log ...
0
votes
1
answer
929
views
Need to add style(background color) to each cell in excel angular,xlsx "version": "0.14.1",
How to style the cell based on json response
json response:
{
"position": 0,
"clientLocation": "XPS-Kitchen",
"upStream": "92.772",
&...
0
votes
0
answers
105
views
Application.OnTime - Worksheet_Calculate - Interference
Application.OnTime only works when Excel is in ready mode. When you use Worksheet_Calculate() event Excel is never in ready mode since the worksheet is constantly calculating (in this case). A ...
1
vote
1
answer
514
views
How To Pass If Condition To Excel VBA Text Join?
How does one pass an if condition in Textjoin into the VBA equivalent?
ie. my working formula in Excel currently is:
=TEXTJOIN("",TRUE,IF(M1:M100=1,N1:N100,""))
This is to join ...
2
votes
0
answers
57
views
How to automate Solver with a Worksheet Change event?
I am working on a sales projection model based on a sigmoid curve. As part of the model, I hope to fit the curve to available historical data, using the sum of squared differences (SUM) between the ...
0
votes
0
answers
13
views
Store data by using FILTER Function within VBA [duplicate]
I have a database which I'm trying to store data from a specific column of it.
Thus, I decided to use 'Worksheetfunction.Filter', as it would be followed in Excel.
=FILTER(D2:D14;E2:E14=BU2)
, where: ...
0
votes
0
answers
204
views
Run-time error '1004': Unable to get VLookup property of WorksheetFunction class
I am trying to make an application on vba in excel. I want the labels to be filled according to the registry number selected in ComboRegister. However, while I am not getting any error for the first 5 ...
0
votes
0
answers
189
views
Include worksheet change event automatically
If I create a new sheet in a workbook via macro, is there a way to automatically also include a code for worksheet_change event on that sheet.?
I am creating sheet with name "Group A" in a ...
1
vote
1
answer
146
views
how to distinguish between manual cell change and automatic cell change on excel vba
I hope you're doing well
I have a sheet in which I have members of project team. It contains two rows : The first one is for the ID and the second one is for the name
When the sheet is activated, the ...
1
vote
0
answers
52
views
Worksheet Change function doesn't stop and causes overflow [duplicate]
I have code that very simply when something is entered into a column, it selects all of the worksheets and copies it into those worksheets in the same column in the same row. Why then does the code ...
1
vote
1
answer
423
views
Is there a way to check the value of the cell to the left and add two to the count, unless there is a value entered in another cell in the same row?
I am trying to write a piece of code in Google Sheets that automatically creates a follow-up date based on the date in the immediate left cell. It gets that date, and adds two (days) to it. Then that ...
0
votes
0
answers
57
views
Sumif for Specialcellsvisible not working and summing in total and not visible cells only
Sumif for Specialcellsvisible not working and summing in total and not
visible cells only
My Code is:-
ws2.Cells(i, J).Value = Application.WorksheetFunction.SumIf(ws1.Range("G:G"), ws2....
1
vote
1
answer
55
views
Return row address when specific cells are filled
I have some code that will return the row address when any of the column C:C is filled.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
For Each c In Target.Cells
If ...
0
votes
1
answer
244
views
How to use Excel VLOOKUP function with words that begin with the letters AB
I have a list of words that I use for title naming. As I create more names, I want to check to ensure I am not duplicating previously used words. My Excel formula seemed to work fine, until I hit ...
0
votes
0
answers
82
views
How to build a cell reference using index/match
I'm trying to use index match to pull some data but I want to protect against future re-arranging of columns
so in my index/match formula, rather than hardcode column C:C, I'd like to embed another ...
0
votes
0
answers
28
views
How to Use WorksheetFunction.Vlookup to copy data from different worksheets and list common variables
Sub Packaging_run_dropbox_change(ColRef As Integer)
On Error Resume Next
'Created by Marc Hipolito on 26/10/2021
'# This subroutine is a slave routine used by all
'# Packaging run dropbox routines
'...
0
votes
1
answer
390
views
VBA SumIfs Too Slow
I have a WorksheetFunction.SumIfs with 3 Args code being applied in so many cells (10k rows x 20 columns), it ran for 2 hours to get complete, but when I do the same but with formula in excel and drag ...