Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help with ActiveCell.HasFormula

Hi,

Can anybody suggest a way of getting the following function to work please,
or tell me why the one I have shown does not work? I want to loop through a
range of cells, and record the cell reference for all cells that contain a
formula, or a couple of text strings:-

For COL = intStartCol To intEndCol
For ROW = intStartRow To intEndRow
ActiveCell = Workbooks(strAnalysisFile) _
.Worksheets(strSourceSheet).Cells(ROW, COL)

' If cell contains a formula, this will be an RF
' Also record locations of N/A and Tens
If ActiveCell.Value = "N/A" Or ActiveCell.Value = "Tens" _
Or ActiveCell.HasFormula = True Then
RfFlag = True
i = i + 1
Workbooks(strThisFile).Worksheets("RF_Locations") _
.Cells(i, j) = (ROW & "," & COL)
End If

Next ROW
Next COL


By changing "ActiveCell.HasFormula = True" to
"Workbooks(strAnalysisFile).Worksheets(strSourceSh eet).Cells(ROW,
COL).HasFormula = True" the test works

Thanks in advance for your help,
Paul.

As an extra snippet of info, the address of ActiveCell remains at $A$1
throughout the above loop: which begs the question, why does the loop find
all the "N/A" and "Tens" strings, but not the formula?
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
HasFormula John Wirt[_12_] Excel Programming 1 February 7th 06 04:07 AM
Name the ActiveCell Vikxcel Excel Programming 1 October 19th 05 01:37 AM
HasFormula protect cell SIGE Excel Programming 7 May 19th 05 05:24 PM
activecell slikity Excel Programming 7 December 13th 04 11:59 AM


All times are GMT +1. The time now is 10:48 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"