Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default macro shortcut help

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 342
Default macro shortcut help

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i change the shortcut key for a macro? John Boy[_2_] Excel Discussion (Misc queries) 1 December 19th 08 06:04 PM
Shortcut to a Macro Susan Excel Discussion (Misc queries) 2 July 11th 08 05:18 PM
Shortcut key to VB macro Joe Excel Discussion (Misc queries) 4 December 30th 05 01:46 PM
Macro Shortcut Key MWSoccer18 Excel Discussion (Misc queries) 4 August 4th 05 08:25 PM
macro code shortcut Brian Excel Worksheet Functions 4 December 15th 04 08:59 PM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"