Need Help - Small fix required

arjunmca

New Member
Joined
Oct 1, 2008
Messages
17
Hi,
I wrote the below code to clear 'B5' cell value.

Worksheets("Sheet1").Range("B5")=""

Its working fine in Win 2000. But in Excel 2007 it is giving the following error on VISTA OS.

Run-time error '-2147417848 (80010108)':
Method 'Value' of object 'Range' failed

Can any body fix that error.
-Arjun.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Thanks for your reply.

(1) Worksheets("Sheet1").Range("B5").value=""

Still the same error coming.

(2). Worksheets("Sheet1").Range("B5").clearcontents

Cell is not clearing the contents. The value remains in the B5 cell.
Do we need to use screen updation.
I even tried with Application.ScreenUpdating=True.

But it is not clearing the cell.

Please try to fix this error.
 
Upvote 0
Don't know what's happening, but
Code:
Sub Fanugi()
Sheets("Sheet1").Range("$B$5").ClearContents
End Sub
works, as does
Code:
Sub Fanugi2()
[B5].ClearContents
End Sub
lenze
 
Upvote 0
Hi,

I tried as you replied. But still getting the same error in 2007 office in Vista OS.

Sheets("Sheet1").Range("$B$5").ClearContents
[B5].ClearContents


Can you please confirm that after the testing the code in 2007 office in Vista system.

Regards,
Arjun.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top