Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Can you tell me what is wrong with this code? wksDump.Range(Cells(2, 1), Cells(1000, 256)).ClearContents If I put in wksdump.cells.clearcontents it clears the whole sheet. I want to keep the data in row 1. hope you can help. Thanks, Matt |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() cells is the whole sheet -- Don Guillett Microsoft MVP Excel SalesAid Software "MJKelly" wrote in message ... Hi, Can you tell me what is wrong with this code? wksDump.Range(Cells(2, 1), Cells(1000, 256)).ClearContents If I put in wksdump.cells.clearcontents it clears the whole sheet. I want to keep the data in row 1. hope you can help. Thanks, Matt |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Those Cells() don't refer to wksDump. If the code is in a general module, they
refer to the active sheet. If the code is behind a worksheet, they refer to the sheet with the code: Either: wksDump.Range(wksdump.Cells(2, 1), wksdump.Cells(1000, 256)).ClearContents or with wksDump .Range(.Cells(2, 1), .Cells(1000, 256)).ClearContents end with (notice the dots in front of .range() and both .cells().) or even... wksDump.Cells(2, 1).resize(999,256).clearcontents MJKelly wrote: Hi, Can you tell me what is wrong with this code? wksDump.Range(Cells(2, 1), Cells(1000, 256)).ClearContents If I put in wksdump.cells.clearcontents it clears the whole sheet. I want to keep the data in row 1. hope you can help. Thanks, Matt -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With Sheets(wksDump)
..Range(Cells(2, 1), Cells(1000, 256)).ClearContents End With I'm assuming that wksDump is the name of a sheet... -- Ak "MJKelly" wrote: Hi, Can you tell me what is wrong with this code? wksDump.Range(Cells(2, 1), Cells(1000, 256)).ClearContents If I put in wksdump.cells.clearcontents it clears the whole sheet. I want to keep the data in row 1. hope you can help. Thanks, Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clearing cells without clearing formulas | Excel Discussion (Misc queries) | |||
Clearing Cells | Excel Programming | |||
Clearing cells | Excel Programming | |||
Clearing Cells | New Users to Excel | |||
Clearing cells | Excel Programming |