Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello I have a Macro set up in spreadsheets I have made for multiple people.
I have set it up so they can paste the info needed in a worksheet and then use the shortcut ctr(a) to run the macro below to delete all rows with lab in it. Sub Find_LAB() Dim rng As Range Dim what As String what = "LAB" Do Set rng = ActiveSheet.UsedRange.Find(what) If rng Is Nothing Then Exit Do Else Rows(rng.Row).Delete End If Loop End Sub This worked well for a while but now I find that the shortcut is not working. any idea why this is? thanks for any help! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I couldn't make sense of your code so I wrote this to do what I think you want:
Sub mcrDelete_If_LAB() Dim rngRow As Range For Each rngRow In ActiveSheet.UsedRange.Rows If Not rngRow.Find("LAB") Is Nothing Then rngRow.Delete End If Next rngRow End Sub Try It Tom |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do i change the shortcut key for a macro? | Excel Discussion (Misc queries) | |||
Shortcut to a Macro | Excel Discussion (Misc queries) | |||
Shortcut key to VB macro | Excel Discussion (Misc queries) | |||
Macro Shortcut Key | Excel Discussion (Misc queries) | |||
macro code shortcut | Excel Worksheet Functions |