Hi,
I need help adjusting a macro and creating a macro.
The first macro, I am looking for some help creating.
I have two spreadsheets:
Spreadsheet 1: ListValues.xlsm <-- This Spreadsheet is HUGE
Spreadsheet 2: Picker.xlsm <-- This spreadsheet contains the macro
The macro needs to look at Column A in Picker.xlsm and for a text string.
It needs to then take that value and search in Column G in ListValue.xlsm
If it finds two matches I need it to open a message box alerting me that
two matches were found.
When it finds a match I need it to copy certain cells in the row where the match is found.
It then needs to paste these values into spesific into cells on the same row as the source (search value)
Once completed It needs to move onto the next row and do the same thing, but there might be blank/empty rows and if there is one it needs to skip that row.
The following macro I need help making it better/faster.
Basically the point of the macro is to go through all cells in column A, it is supposed to remove one of the three text values from each row (some rows might not have any of them in) and move onto the next row
At the moment, I think my current macro selects all cells in column A with data in and replaces Fresh with nothing/null (basically removes it) and then it will check for Tinned and Finally Pureed
I am wanting to change the macro so that if it finds and removes Fresh, for it to skip checking the other options and go to the next cell.
I need help adjusting a macro and creating a macro.
The first macro, I am looking for some help creating.
I have two spreadsheets:
Spreadsheet 1: ListValues.xlsm <-- This Spreadsheet is HUGE
Spreadsheet 2: Picker.xlsm <-- This spreadsheet contains the macro
The macro needs to look at Column A in Picker.xlsm and for a text string.
It needs to then take that value and search in Column G in ListValue.xlsm
If it finds two matches I need it to open a message box alerting me that
two matches were found.
When it finds a match I need it to copy certain cells in the row where the match is found.
It then needs to paste these values into spesific into cells on the same row as the source (search value)
Once completed It needs to move onto the next row and do the same thing, but there might be blank/empty rows and if there is one it needs to skip that row.
The following macro I need help making it better/faster.
Basically the point of the macro is to go through all cells in column A, it is supposed to remove one of the three text values from each row (some rows might not have any of them in) and move onto the next row
At the moment, I think my current macro selects all cells in column A with data in and replaces Fresh with nothing/null (basically removes it) and then it will check for Tinned and Finally Pureed
I am wanting to change the macro so that if it finds and removes Fresh, for it to skip checking the other options and go to the next cell.
Code:
Sub Task1()
Application.ScreenUpdating = False
Dim myLastRow As Long
Dim myLastColumn As Long
Range("A1").Select
On Error Resume Next
myLastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
myLastColumn = Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column
myLastCell = Cells(myLastRow, myLastColumn).Address
Tomato = "A1:" & myLastCell
Range(Tomato).Select
For Each cell In Selection
cell.Value = Replace(cell.Value, "(Fresh)", "", 1, 1, vbTextCompare)
cell.Value = Replace(cell.Value, "(Tinned)", "", 1, 1, vbTextCompare)
cell.Value = Replace(cell.Value, "(Pureed)", "", 1, 1, vbTextCompare)
Next cell
Application.ScreenUpdating = True
End Sub