|
-
Mar 30th, 2005, 05:22 AM
#1
Thread Starter
Frenzied Member
removing a formula from a cell in excel
Hello
I was trying to remove a formula from a cell in excel, till now i have come up with the following
mytype.Worksheets("mytypes").Cells(6 , 6).value = "0"
where the cell (6,6) had the formula, this however leaves the formula updated with the value '0' in place.
-
Mar 30th, 2005, 07:25 AM
#2
Addicted Member
Re: removing a formula from a cell in excel
if you select the cell first and use:
Code:
Selection.ClearContents
if you fail to plan, you plan to fail
-
Mar 30th, 2005, 07:28 AM
#3
Thread Starter
Frenzied Member
Re: removing a formula from a cell in excel
thanks for the reply
how do i select the cell from VB?
-
Mar 30th, 2005, 07:37 AM
#4
Addicted Member
Re: removing a formula from a cell in excel
if you fail to plan, you plan to fail
-
Mar 30th, 2005, 08:23 AM
#5
Thread Starter
Frenzied Member
Re: removing a formula from a cell in excel
i got the following code
Code:
Set excel_doc = GetObject("D:\TEST\excel_doc.xls")
excel_doc.Worksheets("NodeBtypes").Range("E20").Select
Selection.ClearContents
but the third line(i think) throws up the following error
"run time error '424'
Object required"
also i was wondering if i can specify the cell like say
Code:
excel_doc.Worksheets("NodeBtypes").cell(20,5).Select
-
Mar 31st, 2005, 05:10 AM
#6
Addicted Member
Re: removing a formula from a cell in excel
sorry,
The
Code:
Selection.clearcontents
works from within Excel
have a look at this thread for an idea how to reference cells from VB:
Programming Excel from VB6
if you fail to plan, you plan to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|