[Solved] VBA scripting for MS excel

I think this is what you meant, the following code loops through all rows with data, and for each row checks if the word “man” is inside that strings (using the Instr function). Sub FindMan() Dim FindString As String Dim Sht As Worksheet Dim LastRow As Long Dim lRow As Long ‘ modify “Sheet1” to … Read more

[Solved] Copying the cell and delete column under the certain condidions [closed]

Your description is vague, but to get what you described exactly: Public Sub Process() If Range(“A2”).Value <> “” Then Range(“B2”).Copy Range(“C3”) Range(“B2”).EntireColumn.Delete End If End Sub Edit In worksheet code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = Range(“A2”).Address And Range(“A2”).Value <> “” Then Range(“C3”).Value = Range(“B2”).Value Range(“B2”).EntireColumn.Delete End If End Sub I think … Read more

[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] IF A BLANK SPACE IS PRESENT IN THE COLUMN HEADING …..AND/OR operator not working in sql statement in c# .net for modifying an excel sheet [closed]

I’m pretty sure that the problem is the space in the name of your Faculty Name column and that this has nothing to do with the use of AND or OR. Please try: sql = “Update [Sheet1$] set A1 = ‘a’ ” + “where Designation = ‘Prof(senior)’ and [Faculty Name] = ‘bob'”; 1 solved IF … 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] I need to be able to match a date and store number to an array that has the store numbers, a date range and return the PO Number on that line

If the search date is in G1… If the search store is in G2… If the data are in columns A, B, C, and D… You can use this formula to return the first PO# where the search date is between the Start and End dates and where the search store matches Store #: =INDEX(D:D,MATCH(1,(A1:A999<=G1)*(B1:B999>=G1)*(C1:C999=G2),)) … Read more

[Solved] In R; I would like to do something in R rather than excel because excel can’t handle the calculation. In excel the calculation is: =A2+SUM($B$2:B2)

Look into dplyr https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html install.packages(“dplyr”) library(dplyr) df <- df %>% mutate(phys_pos=cumsum(length)+position) I am assuming your data.frame is named df Or with base R df$phys_pos <- cumsum(df$length) + df$position 1 solved In R; I would like to do something in R rather than excel because excel can’t handle the calculation. In excel the calculation is: =A2+SUM($B$2:B2)

[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