#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default clear inputs macro

THis macro seems to be clearing all items from the sheet
I only need it to clear the rows i have listed
Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114").Select
Selection.ClearContents
Range("AD11:AD114").Select
Selection.ClearContents
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default clear inputs macro

I see nothing wrong with the code but perhaps try this...

Sub clear_inputs_new()
'
' clear_inputs Macro
'
Range("I11:I114").ClearContents
Range("AD11:AD114").ClearContents
End Sub
--
HTH...

Jim Thomlinson


"unhide all columns" wrote:

THis macro seems to be clearing all items from the sheet
I only need it to clear the rows i have listed
Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114").Select
Selection.ClearContents
Range("AD11:AD114").Select
Selection.ClearContents
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default clear inputs macro

Works for me.

You could shorten it a bit.

Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114,AD11:AD114").ClearContents
End Sub


Gord Dibben MS Excel MVP

On Mon, 26 Apr 2010 11:59:01 -0700, unhide all columns
wrote:

THis macro seems to be clearing all items from the sheet
I only need it to clear the rows i have listed
Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114").Select
Selection.ClearContents
Range("AD11:AD114").Select
Selection.ClearContents
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default clear inputs macro

now I am getting an error that is
cannot change part of a merged cell

"Jim Thomlinson" wrote:

I see nothing wrong with the code but perhaps try this...

Sub clear_inputs_new()
'
' clear_inputs Macro
'
Range("I11:I114").ClearContents
Range("AD11:AD114").ClearContents
End Sub
--
HTH...

Jim Thomlinson


"unhide all columns" wrote:

THis macro seems to be clearing all items from the sheet
I only need it to clear the rows i have listed
Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114").Select
Selection.ClearContents
Range("AD11:AD114").Select
Selection.ClearContents
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default clear inputs macro

Macros and merged cells don't get along. Any possibility you could remove the
mered cell? If not then we need to code around it which is a pain. Perhpas
you could use
Format Cells... | Alignment | Horizontal | Center Across Selection

Looks similar to a merged cell but work better...
--
HTH...

Jim Thomlinson


"unhide all columns" wrote:

now I am getting an error that is
cannot change part of a merged cell

"Jim Thomlinson" wrote:

I see nothing wrong with the code but perhaps try this...

Sub clear_inputs_new()
'
' clear_inputs Macro
'
Range("I11:I114").ClearContents
Range("AD11:AD114").ClearContents
End Sub
--
HTH...

Jim Thomlinson


"unhide all columns" wrote:

THis macro seems to be clearing all items from the sheet
I only need it to clear the rows i have listed
Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114").Select
Selection.ClearContents
Range("AD11:AD114").Select
Selection.ClearContents
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default clear inputs macro

Try:

Sub clear_inputs_new()
ActiveSheet.Range("I11:I114,AD11:AD114").value = ""
End Sub

unhide all columns wrote:

THis macro seems to be clearing all items from the sheet
I only need it to clear the rows i have listed
Sub clear_inputs_new()
'
' clear_inputs Macro
'
ActiveWindow.ScrollRow = 1
Range("I11:I114").Select
Selection.ClearContents
Range("AD11:AD114").Select
Selection.ClearContents
End Sub


--

Dave Peterson
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
clear cells macro Dorothy Excel Discussion (Misc queries) 5 April 7th 08 12:46 AM
Command button to clear inputs mbing916 Excel Discussion (Misc queries) 7 April 2nd 07 10:26 PM
macro to clear cells press313 Excel Discussion (Misc queries) 0 May 24th 06 02:31 AM
Clear shhet with macro Micos3 Excel Discussion (Misc queries) 2 February 20th 06 05:50 PM
Macro to clear cells Esrei Excel Discussion (Misc queries) 5 April 19th 05 01:52 PM


All times are GMT +1. The time now is 01:51 PM.

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"