[Solved] Using specific column values to create a table

I think there are still some questions to be answered (see my comments) but the following is a starting point with some assumptions made. 1) I leave the number of columns for the output table in a constant variable so you can choose how many columns you want: Const numberOfColumnsInTable = 4 2) I make … Read more

[Solved] VBA: For Loop to find maximum value in a column

To get the corresponding value in Column C where column A is max: dim t as long dim rslt as string With Worksheets(“RESOURCE”) ‘ Change to your sheet t = Application.WorksheetFunction.Match(Application.WorksheetFunction.Max(.Range(“AX6:AX29”)),.Range(“AX6:AX29”),0) rslt = .Range(“A6:A29”)(t) Debug.Print rslt End With But this can be done with the following formula on the sheet: =INDEX(RESOURCE!A6:A29,MATCH(MAX(RESOURCE!AX6:AX29),RESOURCE!AX6:AX29,0)) 2 solved VBA: For … Read more

[Solved] Somehow it’s not copying [closed]

You need to avoid using Select and Activate. Set the workbooks, worksheets and ranges to variables and use them. Also when pasting just values avoid the clipboard for speed. Sub GetTW_Data() Dim tWb As Workbook Dim ebayWb As Workbook Dim tWs As Worksheet Dim ebayWs As Worksheet Dim rng As Range Set tWb = ThisWorkbook … Read more

[Solved] How do I use VBA to send cell contents to be used as a PHP variable in a Facebook Graph API call?

You could use a VBA macro like I created below. In my example I made the macro tied to a button click Sub Button1_Click() Set objHTTP = CreateObject(“MSXML2.ServerXMLHTTP”) URL = “http://www.yourdomain.com/page.php?variable=” & ActiveWorkbook.Worksheets(1).Range(“A1”).Value objHTTP.Open “GET”, URL, False objHTTP.setRequestHeader “User-Agent”, “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)” objHTTP.send (“”) End Sub Your PHP script on your … Read more

[Solved] Is there VBA code of the Hungarian Algorithm (Munkres)? [closed]

Here you go: Option Base 1 Sub HungarianAlgorithm() ‘ Code rewritten and expanded by excelCoder321 for the purpose of: ‘ 1) demonstrating intermediary steps, as a companion to the detailed explanation of Munkres Algorithm at https://brc2.com/the-algorithm-workshop/ ‘ 2) allowing N>M-matrices (more rows than columns) ‘ 3) adding option to maximize costs, not just minimize them. … Read more

[Solved] I need a way to Select perticular rows from one excel sheet and copy them in other if condition matches

A simple macro to do your task, Sub copyrow() Dim i As Long, j As Long j = Sheets(“SheetA”).Cells(Rows.Count, “A”).End(xlUp).Row For i = 2 To Sheets(“SheetB”).Cells(Rows.Count, “A”).End(xlUp).Row If InStr(Cells(i, 2), “abc”) > 0 Then Sheets(“SheetA”).Cells((j + 1), “A”) = Cells(i, 1) Sheets(“SheetA”).Cells((j + 1), “B”) = Cells(i, 2) j = Sheets(“SheetA”).Cells(Rows.Count, “A”).End(xlUp).Row End If Next … Read more

[Solved] Compare Columns using VBA Macro

Try this Option Explicit Sub Demo() Dim ws As Worksheet Dim cel As Range Dim lastRowA As Long, lastRowB As Long Set ws = ThisWorkbook.Sheets(“Sheet2”) With ws lastRowA = .Cells(.Rows.Count, “A”).End(xlUp).Row ‘last row of column A lastRowB = .Cells(.Rows.Count, “B”).End(xlUp).Row ‘last row of column B For Each cel In .Range(“A1:A” & lastRowA) ‘loop through column … Read more

[Solved] If cell in column contains specific word then cut the row of the specific word [closed]

Try the next code, please (adapted to search in C:C the string occurrence): Sub TestCutSUBRowsPaste() Dim sh As Worksheet, shDest As Worksheet, strSearch As String Dim i As Long, rngCut As Range, lastRowD As Long, lastRow As Long strSearch = “POS” Set sh = ActiveSheet Set shDest = Worksheets.aDD lastRow = sh.Range(“A” & Rows.count).End(xlUp).row For … Read more

[Solved] Count in Excel using macro

countifs(“E:E”, “jasper”,”G:G”,”S”) will give you number of instances of jasper with S as status, and similarly countifs(“E:E”, “jasper”,”G:G”,”A”) will give you number of instances of jasper with A as status solved Count in Excel using macro

[Solved] VBA Macro that gets range of rows in column A and replace them with values in column B

Answer for your question Sub Test() Dim RangeX As Variant RangeX = InputBox(” Enter Range of rows. For Example rows 3 & 4 Means 3-4″) Row1 = Left(Trim(RangeX), 1) Row2 = Right(Trim(RangeX), 1) For i = Row1 To Row2 Cells(i, 1).Value = Cells(i, 2).Value Cells(i, 3).Value = “Values Replaced” Next MsgBox “Process Completed” End Sub … Read more

[Solved] Macro code to generate a formatted Excel

Try it like this. Public Sub MyFilter() Dim lngStart As Long, lngEnd As Long lngStart = Range(“E1”).Value ‘assume this is the start date lngEnd = Range(“E2”).Value ‘assume this is the end date Range(“C1:C13″).AutoFilter field:=1, _ Criteria1:=”>=” & lngStart, _ Operator:=xlAnd, _ Criteria2:=”<=” & lngEnd End Sub All details are here. https://www.extendoffice.com/documents/excel/910-excel-filter-between-two-dates.html solved Macro code to … Read more

[Solved] Excel Macro to Locate Duplicate Values of a Column and Copy Adjacent Cells [closed]

Sub main() Dim hold As New Collection For Each celli In Columns(5).Cells On Error GoTo raa If Not celli.Value = Empty Then hold.Add Item:=celli.Row, key:=”” & celli.Value End If Next celli On Error Resume Next raa: Range(“a1:b1”).Offset(celli.Row – 1, 0).Value = Range(“a1:b1”).Offset(hold(celli.Value) – 1, 0).Value Resume Next End Sub 1 solved Excel Macro to Locate … Read more

[Solved] Don’t know how program a button to open file explorer that can open any document

Someone else was able to answer my question on another forum. Credit goes to Trebor76 from Ozgrid for the user friendly solution. This is the solution that was given to me. This was pretty plug and play. Option Explicit Sub Acessdocumentexplorer_Click() ‘The following has been adapted from here: ‘https://msdn.microsoft.com/en-us/vba/excel-vba/articles/application- filedialog-property-excel Dim lngCount As Long ‘Open … Read more