[Solved] Find text and show value if condition is met

I’ve got an answer that will find the first instance of USD and check if TOTAL PURCHASE is 9 rows below it, if found then copy the adjacent cell to D1, if not found then search for the next USD and repeat the checks: Option Explicit Sub vbavjezba() Dim total As Variant Dim usd As … Read more

[Solved] Delete rows base on the input box date [closed]

You can try this, just set ws to whatever worksheet you have your dates in Sub datechecker() Dim inputBoxText As String Dim inputBoxDate As Date Dim lastRow As Integer Dim row As Integer Dim ws As Worksheet Set ws = ThisWorkbook.Worksheets(1) With ws lastRow = .Cells(.Rows.Count, “K”).End(xlUp).row inputBoxText = InputBox(“Please enter a Date:”, “Date Input … Read more

[Solved] How to delete rows based on condition in VBA? [duplicate]

The issue is that once a row has been deleted, the macro will continue onto the next row (skipping a row). Working backwards through the loop will prevent any rows being missed so something like: Sub DeleteRowsPiuDi40Mega() Dim LastRow As Long Dim ws4 As Worksheet Set ws4 = ActiveWorkbook.Sheets(“atm_hh”) LastRow = ActiveSheet.Range(“C” & ActiveSheet.Rows.Count).End(xlUp).Row For … Read more

[Solved] Comparing Sheetnames of different excel workbooks and Storing the result in the third sheet

Here, this will do what you want. Option Explicit Sub FileListingAllFolder() Dim pPath As String Dim FlNm As Variant Dim ListFNm As New Collection ‘ create a collection of filenames Dim OWb As Workbook Dim ShtCnt As Integer Dim Sht As Integer Dim MWb As Workbook Dim MWs As Worksheet Dim i As Integer ‘ … Read more

[Solved] How to use Excel Formulas in VBA?

To use Excel formula in VBA you have two choices: you can either Evaluate the function string as in @YowE3K’s example given here, or alternatively you can use the WorksheetFunction method to perform most Excel functions. The Evaluate method is best if you want to do a fixed formula like your example suggests and return … Read more

[Solved] vba code to search google using cell content as search criteria [closed]

There’s no need for VBA if all you want to do is open a Google search page one at a time. With your search phrase in A1, use this formula, for example: =HYPERLINK(“http://www.google.com/search?q=” & A1,A1) and fill down as far as required. That will put a clickable link in column B, corresponding to the search … Read more

[Solved] Select range of cells with same value and find the middle cell [closed]

This returns the column name: =INDIRECT(ADDRESS(1,CEILING((MATCH(MIN($BHS2:$BWT2),$BHS2:$BWT2) – MATCH(MIN($BHS2:$BWT2),$BHS2:$BWT2,0))/2 + MATCH(MIN($BHS2:$BWT2),$BHS2:$BWT2,0),1))) (if you know that the smallest group is always the first group, then this could be simplified a little) This returns the value =min($BHS2:$BWT2) Do you actually want to return both “4” and “PRT Product 322” in BWU2? i think it would be better to … Read more

[Solved] conditionally concatenate text from multiple records in vba [duplicate]

Try the below code, it assumes you have headers and that unique ID is in column A and description in column B. Option Explicit Sub HTH() Dim vData As Variant Dim lLoop As Long Dim strID As String, strDesc As String ‘// Original data sheet, change codename to suit vData = Sheet1.UsedRange.Value With CreateObject(“Scripting.Dictionary”) .CompareMode … Read more

[Solved] What does this VBA code do, is it safe [closed]

yes, it’s safe. all it does is to brute-force the password used for protecting the sheet/workbook. It both unlocks the sheet and then prints the password out for you (which will be something odd like AAABBAAAABBAA – but it will work). The code itself does not do any harm to the pc or the user … Read more

[Solved] Add 1 day to todays date whenever value gets repeated

Use Application.Countifs: Sub Add_date2() Dim ws As Worksheet Set ws = ActiveSheet ‘better to set the actual sheet WorkSheets(“Sheet1”) With ws Dim lastRow As Long lastRow = .Cells(Rows.Count, 1).End(xlUp).Row Dim iCntr As Long For iCntr = 2 To lastRow If .Cells(iCntr, 1) <> “” Then .Cells(iCntr, 2) = Date + Application.CountIfs(.Range(.Cells(2, 1), .Cells(iCntr, 1)), .Cells(iCntr, … Read more

[Solved] Defining and adding values to arrays inside an array in VBA Excel

Based on the description you’ve given, follow my suggestion. Please, give us your feedback. Private Function AmazingFunction(inputArray As Variant) Dim size As Long Dim i As Long Dim tmp As Variant Dim newArray() As Variant size = UBound(inputArray) ‘ Array size ReDim newArray(size) ‘ Resizes another array to the same size For i = 0 … Read more

[Solved] triangular pyramid, trigonal pyramid offset-3d-Plane-Intersection By vbasolver

I check from sympy import * var(‘m’) def myUnitVector(myPoint3D): myL=myPoint3D.distance((0, 0)) return Point3D(myPoint3D.x/myL,myPoint3D.y/myL,myPoint3D.z/myL) def myHtoP(myHairetu): return Point3D(myHairetu[0],myHairetu[1],myHairetu[2]) def my3PLaneIntersection(PTO,PTA,PTB,PTC,RA,RB,RC): vA =myUnitVector(myHtoP(Plane(PTO, PTB, PTC).normal_vector)) PLA=Plane(PTO + RA * vA, normal_vector=vA) vB =myUnitVector(myHtoP(Plane(PTO, PTC, PTA).normal_vector)) PLB=Plane(PTO + RB * vB, normal_vector=vB) vC =myUnitVector(myHtoP(Plane(PTO, PTA, PTB).normal_vector)) PLC=Plane(PTO + RC * vC, normal_vector=vC) return PLC.intersection(PLB.intersection(PLA)[0]) def myProjection(PTO,PTA,PTC,PTOO): v = … Read more