inactive sheet clear content

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi all
could someone guide me how do I clean the content of a specified range on an
inactive worksheet?
thanks a lot
 
Specify the range to clear:-

Sub clearanysheet()
Worksheets("Sheet1").Range("A1:A10").Clear
End Sub

Mike
 
thanks for your answer.
I've got the following piece of code which doesn't really want to work

i = 4: j = 3
col_f = j
Do While Ff.Cells(i, 1).Value <> ""
indice = Ff.Cells(i, 1).Value
k = InStr(1, indice, "*")
If k = 0 Then
Ff.Range(Cells(i, 3), Cells(i, 4)).Clear
End If
i = i + 1
Loop
what am I doing wrong?
 
catrrmg said:
thanks for your answer.
I've got the following piece of code which doesn't really want to work

i = 4: j = 3
col_f = j
Do While Ff.Cells(i, 1).Value <> ""
indice = Ff.Cells(i, 1).Value
k = InStr(1, indice, "*")
If k = 0 Then
Ff.Range(Cells(i, 3), Cells(i, 4)).Clear
End If
i = i + 1
Loop
what am I doing wrong?

You probably also have to do this:

Ff.Range(Ff.Cells(i, 3), Ff.Cells(i, 4)).Clear

Not 100% sure, since I'm not sure if Ff is the inactive worksheet-object.

CoRrRan
 
thanks a lot.
it does work.

CoRrRan said:
You probably also have to do this:

Ff.Range(Ff.Cells(i, 3), Ff.Cells(i, 4)).Clear

Not 100% sure, since I'm not sure if Ff is the inactive worksheet-object.

CoRrRan
 

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