Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I'm using a selectionloop macro which goes through whole column A, activate the record if letter "y" is registered, and fullfill for that specific record some copy/paste actions. I want to change the macro on such a way that it runs only through selected fields and within that selected fields look in column A and do the actions if letter "y" is registered (For example : I have selected record 10 till 15 -or- field B12 till B20 -or- record 10 and with CTRL record 25 and record 30). Can somebody help me out with a macro which fullfill my wishes. Thanks. 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 regards, Johan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running a macro from currently selected cell? | Excel Discussion (Misc queries) | |||
Running macro from currently selected cell? | Excel Discussion (Misc queries) | |||
Run a macro only for the selected fields(records) | Excel Programming | |||
Macro to Export Selected fields to an Existing Access Database | Excel Programming | |||
Running a macro in a selected cell... | Excel Discussion (Misc queries) |