#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Clear Cells Content

I have this VBA code to clear cells content, but it is not clearing the
content...

Set wkSheet = Worksheets(sName)

For iCount = 53 To 92
wkSheet.Cells(nRowNumber, iCount).Clear
Next

Why?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Clear Cells Content

If I wanted to clear the cell's contents, I would have used:

wksheet.cells(nrownumber, icount).clearcontents

But your code should have worked ok. Are you sure you're looking at the correct
worksheet? And the correct row?



No_Spam wrote:

I have this VBA code to clear cells content, but it is not clearing the
content...

Set wkSheet = Worksheets(sName)

For iCount = 53 To 92
wkSheet.Cells(nRowNumber, iCount).Clear
Next

Why?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Clear Cells Content

Pardon my confusion, but where is nRowNumber defined, and what is it's value?

As I understand the .Cells() property, it needs a (row, column) reference
and while the example formula shows a variable being used for the row
reference, I don't see where it is coming from? Could cells in wrong rows be
getting cleared?

"Dave Peterson" wrote:

If I wanted to clear the cell's contents, I would have used:

wksheet.cells(nrownumber, icount).clearcontents

But your code should have worked ok. Are you sure you're looking at the correct
worksheet? And the correct row?



No_Spam wrote:

I have this VBA code to clear cells content, but it is not clearing the
content...

Set wkSheet = Worksheets(sName)

For iCount = 53 To 92
wkSheet.Cells(nRowNumber, iCount).Clear
Next

Why?


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using List Box To Clear Cells evan Excel Worksheet Functions 0 July 24th 06 04:09 PM
How do I find cells with linked content Cowtoon Excel Discussion (Misc queries) 5 January 19th 06 12:38 PM
To clear visable cells in a subtotal - can it be done? NoelH Excel Worksheet Functions 2 August 8th 05 09:34 AM
exchange content of cells \jeremy via OfficeKB.com\ Excel Discussion (Misc queries) 1 July 6th 05 06:49 PM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM


All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"