Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Delete contents in cells with macro

I would like to select any cell and delete the contents in that cell and 10
cells to the right of that cell. Can I create a macro to do that?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Delete contents in cells with macro

Sub dford()
Dim r As Range, r2 As Range

Set r2 = Selection
Set r = Range(r2, r2.Offset(0, 10))

r.Clear
End Sub

--
Gary''s Student
gsnu200703


"dford" wrote:

I would like to select any cell and delete the contents in that cell and 10
cells to the right of that cell. Can I create a macro to do that?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Delete contents in cells with macro

Sub clearcells()
ActiveCell.Resize(1, 10).ClearContents
End Sub

--
Don Guillett
SalesAid Software

"dford" wrote in message
...
I would like to select any cell and delete the contents in that cell and 10
cells to the right of that cell. Can I create a macro to do that?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Delete contents in cells with macro

Thanks for the help.

"Don Guillett" wrote:

Sub clearcells()
ActiveCell.Resize(1, 10).ClearContents
End Sub

--
Don Guillett
SalesAid Software

"dford" wrote in message
...
I would like to select any cell and delete the contents in that cell and 10
cells to the right of that cell. Can I create a macro to do that?




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
Recorded macro has hard cell contents. DocBrown Excel Discussion (Misc queries) 4 August 11th 06 07:16 PM
delete pictures with a macro Noel Rietman Excel Discussion (Misc queries) 1 March 20th 06 04:43 PM
how do i create a macro that would check the contents of cells Jade Excel Discussion (Misc queries) 1 December 31st 05 01:37 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Macro do delete values in cells Esrei Excel Discussion (Misc queries) 1 April 14th 05 04:01 PM


All times are GMT +1. The time now is 02:36 AM.

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

About Us

"It's about Microsoft Excel"