Can someone explain what this code is doing line by line?
Public Function FastCut(s As String) 'returns first n chars which fit pattern *nn? Dim x As Long Dim flag As Boolean Dim a As String For x = 1 To Len(s) a = a & Mid(s, x, 1) If IsNumeric(Right(a,...
View ArticleVBA - Run-time Error 13 Type Mismatch using WorksheetFunction.SumIFs
Can you please advise how to fix the following code which uses SUMIFS? I managed to get them together from a lot of sources and I'm aware that there must be something wrong with the data types.Sub...
View ArticleHow to manipulate the string in the cells
I have three columns in an Excel spreadsheet, First Name, Last Name, and EmailThe raw data on those fields like thisSunny M, Jones, sunnyj@woody.com (the first name including the middle initial on some...
View ArticleHow to select and order elements of a column in python?
i need the help of the community to solve an issue. Basically i have a excel database with a series of information: train number, departure date, fare, owner of the train (NTV or TRN) and the market...
View ArticleVBA break up insert into tables so that I do not go over 1000
This questions is follow up from here. What I need to do now is break up the insert into command in SQL so that I am do not exceed the limitations.This is what I have so far:Sub second_export() Dim...
View ArticleExcel conditional formatting formula error
I am trying to detect and highlight duplicate with the custom conditional formatting below. However i get an error prompt when i try to do so in the screen shot attached. Can anyone, help me with...
View ArticleCan I write UDF inside an Evaluate formula strings in VBA?
I have defined the next formula to enter it as an Array Formula: =IF(LenTableRange(Hoja1!$B$15)=Hoja1!$B$4,IF(OFFSET(LenTableRange(Hoja1!$A$15),0,5)="",LenTableRange(Hoja1!$A$15)))For some extra info:...
View ArticleHow to calculate rolling volatility of returns data using Exponential...
I have a dataset that consists of the closing price and date for 10 years. I want to calculate the rolling 3-day volatility of returns data using Exponential Weighted Moving Average. Please mention how...
View Article2nd step of Python loop is not executing properly [closed]
Below is the code, which matches sheet name, then row value, then column headers & sub headers across 2 excel files, & then pastes the value from 1 file to the other. The code works fine till...
View ArticleFinding and compiling data from multiple workbooks
I regularly receive workbooks from business partners. They all use the same template. What I'd like to do is pull in the partner name (always in the same cell) L1 and the "Totals:"(Column B) for the...
View ArticleExcel VBA On Error Goto not working to stop sheet being added
My code is as below:Sub NewWorksheetTest() Dim wsname As String wsname = InputBox("Enter a name for the new worksheet") On Error GoTo BadEntry Sheets.Add ActiveSheet.Name = wsname Exit Sub BadEntry:...
View ArticleSubtracting a comma separated string from another in Excel [closed]
If I have A1= 1,2,3,4,5,6,7,8,9A2=2,6,9My desired result should be in cell A3 After substation (A1-A2) =1,3,4,5,7,8while it was very easy when A2=2,3,4 (serially) via substitute function.
View ArticleRead multiple xlsx files with multiple sheets into one R data frame
I have been reading up on how to read and combine multiple xlsx files into one R data frame and have come across some very good suggestions like, How to read multiple xlsx file in R using loop with...
View ArticleVBA doesnt run when cell value changes
I am trying to get this macro run automatically when a value in the target cell changes but it's not working, searched solutions for hours but am still hitting the wall, sorry I am new to VBA. Really...
View ArticleHide only specific workbook without affecting other workbook
Already circled the internet and has the same answer that did not work as I wanted to be.Q: How to hide workbook and show userform without hiding other workbook?This code is good but hides other...
View ArticleLooping through worksheets in a workbook and consolidating each workbook in...
I have search and search for an answer to my code issue but I cant find any. I will be very grateful if someone can take a look at my code. At the moment, I have several large workbooks for data for...
View ArticleExcel VBA:How to use StrComp in a While statement when one string is a text...
The code returning an error is the first line of the following: While StrComp(selectedRecipe, dataSheet.Cells(i, 1)) <> 0 recipeRow = recipeRow + 1 i = i + 1 Wend The debug I'm getting has issues...
View ArticleExcel VBA/Formula to find a cell that includes search term?
I was not sure how to really create the question... But the problem I am having is this: I have a list (in rows) that relate to a regulatory document, and after trying to create some sort of for loop...
View ArticleSet Const Conditionally at compile time in VBA
I'd like to set the value of a const variable conditionally at Compile time. I thought i could achieve this using vba compiler directives #If #Else etc. as below, but have been unsuccessful so far:#If...
View ArticleHow to cycle through borders in Excel and change their color
I am trying to figure out a way to cycle through active borders in Excel and to change their colors to "next one" with each macro run.Here is the code I've got:Dim Color1 As Variant Dim Color2 As...
View Article