List box VBA script to clear cell in other sheet.

G

Guest

Hi!
I have a vba script that I use for the option "clear cell" from a list box.
Now I want it to be able to clear cells in other sheets aswell. My script
looks like this:


If LCase(.Value) = LCase("clear choices") Then
Selection.Offset(1, -2).ClearContents
Selection.Offset(0, 0).ClearContents
etc....
 
G

Guest

worksheets("MySheet").range("A1").offset(1,-2).clearcontents

HTH,
--
Gary Brown
(e-mail address removed)
If this post was helpful to you, please select 'YES' at the bottom of the
post.



Calle said:
Hi!
I have a vba script that I use for the option "clear cell" from a list box.
Now I want it to be able to clear cells in other sheets aswell. My script
looks like this:


If LCase(.Value) = LCase("clear choices") Then
Selection.Offset(1, -2).ClearContents
Selection.Offset(0, 0).ClearContents
etc....

worksheets("MySheet").range("A1").offset(1,-2).clearcontents
 

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