LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Using a macro to delete cells from any row

Good morning,
I have set-up the following macro to delete certain cells of a row.

Sub test()
'
' test Macro
'
' Keyboard Shortcut: Ctrl+t
'
Range("A19:A19").Select
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
Range("A19:I19,L19,N19:U19").Select
Range("A19").Activate
Selection.ClearContents
End Sub

It deletes the cells that I need it to, however it always deletes the cells
in row 19 (Since that is where I recorded the macro). What can I put in the
code to get the macro to delete the cells from whatever row is active (i.e.
if I click on cell "A4" have the macro delete the cells in row 4, or if cell
"A250" is clicked it deletes the cells in row 250 etc...)? Thanks for any
help that can be provided.

Chad
 
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
Macro to delete certain cells Chris_t_2k5[_2_] Excel Programming 2 April 3rd 06 03:34 PM
macro to select cells containing specific text and delete all cells but these JenIT Excel Programming 3 March 27th 06 10:07 PM
Macro to delete row with protected cells Turboj Excel Programming 3 February 21st 06 04:42 AM
Macro to delete all blank cells Brian Excel Programming 2 December 15th 05 12:26 AM
How do I set up a macro to automatically delete certain cells? Husker87 Excel Programming 4 September 30th 05 10:05 PM


All times are GMT +1. The time now is 06:44 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"