Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row)

H
Can anyone explain the difference between the following two methodologies of accessing and writing data to a cell in an excel sheet

1. using
range(column : row).selec
activecell.formular1c1 = <data OR activecell.text = <data

2. Usin
activesheet.cells(column, row) = <data

I have actually seen an application in the last couple of days that was using option 2 to write data to the excel sheet. The only problem was that Excel would continue to remain in memory even though QUIT, setting to nothing was being done on the excel variable instance

However, when i change the code to use Option 1, the excel object was removed from memory

Didnt make sense to me at all. Was hoping that someone could explain this to me

Thank

Ashish Shridharan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row)

Ashish,

Apart from the syntax of the former being wrong, they are basically the
same, with one big proviso. The first does a select, which means that the
sheet being worked upon has to be active and visible so that the screen can
be re-painted.

So 1 does a select and then writes to the selected cell.

The second writes directly to a nominated cell, no selection involved.

As for the memory issue, I do not find this problem in my testing. Both
times Excel clears correctly. Is this being done through automation?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ashish Shridharan" wrote in message
...
Hi
Can anyone explain the difference between the following two methodologies

of accessing and writing data to a cell in an excel sheet ?

1. using
range(column : row).select
activecell.formular1c1 = <data OR activecell.text

= <data

2. Using
activesheet.cells(column, row) = <data


I have actually seen an application in the last couple of days that was

using option 2 to write data to the excel sheet. The only problem was that
Excel would continue to remain in memory even though QUIT, setting to
nothing was being done on the excel variable instance.

However, when i change the code to use Option 1, the excel object was

removed from memory.

Didnt make sense to me at all. Was hoping that someone could explain this

to me.

Thanks

Ashish Shridharan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row)

Hi Bo

The app is a classic ASP app calling a component that generates the Excel file with the data

I couldnt really think of a co-relation between the two but i did see this happen and Excel did go away the minute i changed the code to a Range.select methodology

Thanks
Ashish
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
ActiveCell.FormulaR1C1 Rick Excel Discussion (Misc queries) 3 March 28th 10 10:36 PM
ActiveWorkBook versus ActiveSheet Boiler-Todd Excel Discussion (Misc queries) 5 September 21st 09 10:42 PM
ActiveCell or ActiveSheet Launchnet Excel Worksheet Functions 1 July 20th 07 07:46 PM
Whats wrong with this VBA statement -ActiveCell.FormulaR1C1...? hal Excel Programming 5 November 8th 03 02:48 AM
ActiveCell.FormulaR1C1 Leif Rasmussen Excel Programming 1 October 16th 03 09:46 AM


All times are GMT +1. The time now is 07:42 AM.

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"