LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Clearing Row data for a given range

On 5 Set, 00:11, Santhosh Pasupuleti
wrote:
I really appreciate you guys spending time on this. I will make it simple.. I
tried as suggested by you and Dave. I dont have any formulas in the sheet but
this data is referenced from different sheet using formulas. Please find the
code below:
As stated in MSDN, the only difference between this property and the Value
property is that the Value2 property doesn’t use the Currency and Date data
types. Since the object doesnt show Value property, I decided to use Value2.

* * * * * * ws = (Excel._Worksheet)wb.ActiveSheet;
* * * * * * Excel.Range rj;
* * * * * * rj = ws.Rows.get_Range("A1", "Z100");
* * * * * * rj.Select();
* * * * * * rj.Value2 = "";
* * * * * * wb.Save();

Still it doesnt work.

Thanks and Regards,
Santhosh Kumar.P
---------------------------------------------------------------------------*--------------------------



"JLGWhiz" wrote:
If you have no formulas in the range you are attempting to clear, then
ClearContents should work. *If you do have formulas in the range, the
ClearContents will also clear the formulas and you indicated that you only
wanted to clear the data. *To just clear the data, you would have to make
the Value of the cells in the range equal a null string value. *Like Dave
stated. I am not really sure about the code you are using. *It appears that
you are trying to Set amd object variable but with the Set keyword. *The way
it is written, if it did anything it would create a variable for a massive
array, I think. *If you are trying to create rj as a range then you would
have to use the Set statement. *Then the range would have a value property
and you could use the null string to clear the data in the range.


"Santhosh Pasupuleti" wrote
in ...
Thanks for the quick reply. There is no property called Value for range
and
there is "range2". Were you referring to this? And why isnt the clear
contents method working? any Idea?


"JLGWhiz" wrote:


Try:


rj.Value = ""


"Santhosh Pasupuleti" <Santhosh
wrote
in ...
Hi,


I am trying to clear the row data keeping formatting in tact and
unfortunately the code below doesnt work. I tried using Clear contents
menthod as well as clear notes and it is of no use. Can anyone please
tell
me
how to delete the data keeping row formatting in tact?


ws.Rows.get_Range("A1", "Z" +
(dss.Tables[0].Rows.Count).ToString()).ClearContents();
or


Excel.Range rj;


* * * * * *rj = ws.Rows.get_Range("A1", "Z" +
(dss.Tables[0].Rows.Count).ToString());
* * * * * *rj.ClearContents();


Thanks and Regards,
Santhosh Kumar.P- Nascondi testo citato


- Mostra testo citato -


Hi Santosh.
It seems you dont know that excel has his own language (Vba); for
beginning to learn the excel Vba you can use the help on line, and
probably this might be an easy matter for people like you.
Regards
Eliano
 
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
Clearing contents from a range G. Yamada[_2_] Excel Programming 13 September 25th 08 07:45 PM
Clearing the Contents of a range of cells David A. Excel Programming 2 November 8th 07 05:59 PM
Clearing Values in a Range under certain conditions Barb Reinhardt Excel Programming 2 November 8th 06 02:24 PM
need some help clearing a range Gary Keramidas Excel Programming 4 August 18th 06 03:07 AM
Clearing a Range Ronald Cayne Excel Programming 4 September 12th 04 04:00 AM


All times are GMT +1. The time now is 05:00 AM.

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

About Us

"It's about Microsoft Excel"