clear inputs macro

U

unhide all columns

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
 
J

Jim Thomlinson

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
 
G

Gord Dibben

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
 
J

Jim Thomlinson

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...
 
D

Dave Peterson

Try:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top