Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Herewith my macro.
It's selecting now each record from the last row till the second (based on letter "y" in column A). The loop should run only within the records of the selected field (which could be a range next to eachother or some fields selected with the CTRL button on) and in the selected records look for the letter "y" in column A and based on that do the actions. Sub LastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row lr = LastRow lr1 = lr + 1 co = 1 For li = lr1 To 2 Step -1 If InStr(Cells(li, co), "y") = 1 Then Cells(li, co).Select acr = ActiveCell.Row Range("B" & acr).Select act = ActiveCell.Text 'on this point the macro does some copy-paste actions to another sheet End If Next li End Sub help me out please. regards, Johan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I remove all records of duplicated fields? | Excel Discussion (Misc queries) | |||
Calculated fields in Records | Excel Discussion (Misc queries) | |||
De-Dupe Records Based on Two Fields. | Excel Discussion (Misc queries) | |||
Duplicate records with various formats for fields | Excel Discussion (Misc queries) | |||
Macro to Export Selected fields to an Existing Access Database | Excel Programming |