Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using List Box To Clear Cells | Excel Worksheet Functions | |||
How do I find cells with linked content | Excel Discussion (Misc queries) | |||
To clear visable cells in a subtotal - can it be done? | Excel Worksheet Functions | |||
exchange content of cells | Excel Discussion (Misc queries) | |||
Convert data of cells to any type: Number, Date&Time, Text | Excel Discussion (Misc queries) |