Clear a range of data

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

I know I can use the code below to clear data from a range, but I need to
clear data from rng(1, 43) through rng(1, 125). Is there any way to do that
without having to write a line for each rng to be cleared?

Sub ClearData()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

rng(1, 43).Value = ""

End Sub
 
Hi

Maybe this:

Range(Cells(ActiveCell.Row, 43), Cells(ActiveCell.Row, 125)).ClearContents

Regards,
Per
 
Dim rng As Range
Set rng = ActiveSheet.Range(Cells(1, 43), Cells(1, 125))
With rng
.Value = ""
End With

Or more simply..................

ActiveSheet.Range(Cells(1, 43), Cells(1, 125)).Value = ""


Gord Dibben MS Excel MVP
 

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

Back
Top