[Solved] VBA – Match Lookup With Multiple Parameters

I got this question answered here by user Subodh Tiwari (Neeraj): https://www.experts-exchange.com/questions/29098511/VBA-VLOOKUP-With-Multiple-Parameters.html#acceptAnswerByMember Sample workbook is attached with the post in this link. Here is the complete code: Sub PlaceFormula() Dim ws As Worksheet Dim lr As Long Dim lc As Long With Application .Calculation = xlCalculationManual .ScreenUpdating = False .EnableEvents = False End With Set … Read more

[Solved] Excel VBA, code to count the # of filled cells, then find highest and 2nd highest and subtract the corresponding column #’s [closed]

I solved this by recording a macro that copys and pastes the data values into another section then I sorted it largest to smallest. I then created a column with the equation to subtract one from the other. solved Excel VBA, code to count the # of filled cells, then find highest and 2nd highest … Read more

[Solved] How to compare two Excel workbook, and if the data matches on both sheet, color code from second should automatically apply to first one [closed]

Try something like if workbooks(“First_workbook address”).sheet1.range(“A1”).value= workbooks(“second_workbook address”).sheet1.range(“C1”).value then workbooks(“First_workbook address”).sheet1.range(“A1”).colour = vbRed Endif solved How to compare two Excel workbook, and if the data matches on both sheet, color code from second should automatically apply to first one [closed]

[Solved] excel multiple column matches [closed]

This code will do what you are intending with the information given. I encourage you to look up the methods used as they are quite fundamental and novice in difficulty. I have put down comments that explain what each section is doing. GL Sub test() Dim filter, C1, C2 As String Dim counter As Integer … Read more

[Solved] get tree structure of a directory with its subfolders and files using C#.net in windows application [closed]

Method 1 HierarchicalItem holds the information we need about an item in the folder. An item can be a folder or file. class HierarchicalItem { public string Name; public int Deepth; public HierarchicalItem(string name, int deepth) { this.Name = name; this.Deepth = deepth; } } SearchDirectory is the recursive function to convert and flatten the … Read more

[Solved] Excel VBA sort bug

Key:=source.Range(source.Cells(rowStart, startNames)… – You shouldn’t have source.Range here – your key is the single cell source.Cells(rowStart, startNames). As a recommendation – change …SortFields.Add2 to …SortFields.Add. The ..Add2 will definitely not work in older versions of Excel. solved Excel VBA sort bug

[Solved] Excel macro to take a screenshot of specific cells and save as image file

This appears to work: Sub Macro1() myFileName = “chrt.png” Range(“G3:J14”).Select Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture Charts.Add ActiveChart.Paste ActiveChart.Export Filename:=ThisWorkbook.Path & “\” & myFileName, Filtername:=”PNG” End Sub But you may need to resize or edit the resulting picture to meet your needs. You also may want to delete the Chart when you are done. 4 solved Excel macro … Read more

[Solved] Extract Last Bracketed Characters from String in Excel VBA

Try this UDF Function ExtractByRegex(sTxt As String) With CreateObject(“VBScript.RegExp”) .Pattern = “V\d+(.)?(\d+)?” If .Test(sTxt) Then ExtractByRegex = .Execute(sTxt)(0).Value End With End Function Update Here’s another version in which you can format the output Sub Test_ExtractByRegex_UDF() MsgBox ExtractByRegex(“A9 V2.3 8.99”) End Sub Function ExtractByRegex(sTxt As String) With CreateObject(“VBScript.RegExp”) .Pattern = “V\d+(.)?(\d+)?” If .Test(sTxt) Then sTxt = … Read more

[Solved] Executing several actions within Before_Close

Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim sh As Worksheet, lastRow As Long, lastCol As Long, emptyCells As Range Set sh = ActiveSheet lastRow = sh.Range(“A” & Rows.Count).End(xlUp).Row lastCol = sh.Cells(4, Columns.Count).End(xlToLeft).Column On Error GoTo NoBlanks Set emptyCells = sh.Range(sh.Cells(4, 1), sh.Cells(lastRow, lastCol)). _ SpecialCells(xlCellTypeBlanks) If Not emptyCells Is Nothing Then MsgBox “There are empty cells, … Read more