Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Eliminate formula Query

I received this code a few months back that eliminates formulas in certain
rows (Sales!A3:A55) where ever a certain date, which is is in C.O.S!H4, then
just copy/paste values, those formulas that are in the cells. Code is as
below

Problem is that a highlighted "rCell" displays compile error shows up -
can't find project or libary.

I have tested the code on just on a blank file with basic data over 2
worksheets and it works fine - where have I gone wrong??

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
dTest = Worksheets("C.O.S").Range("H4").Value
For Each wsSheet In Sheets(Array("Sales"))
With wsSheet
For Each rCell In .Range("A3:A55")
If rCell.Value = dTest Then
With rCell.Offset(0, 1).Resize(, 26)
.Value = .Value

End With
End If
Next rCell
End With
Next wsSheet



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Eliminate formula Query

I don't see anything that would produce that error unless you go to
tools=References in the VBE with your workbook as the active project and
you see a reference marked as MISSING - that can cause that error in unusual
situations.

if that isn't the case, try declaring the rcell variable

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
Dim rCell as Range

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I received this code a few months back that eliminates formulas in certain
rows (Sales!A3:A55) where ever a certain date, which is is in C.O.S!H4,

then
just copy/paste values, those formulas that are in the cells. Code is as
below

Problem is that a highlighted "rCell" displays compile error shows up -
can't find project or libary.

I have tested the code on just on a blank file with basic data over 2
worksheets and it works fine - where have I gone wrong??

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
dTest = Worksheets("C.O.S").Range("H4").Value
For Each wsSheet In Sheets(Array("Sales"))
With wsSheet
For Each rCell In .Range("A3:A55")
If rCell.Value = dTest Then
With rCell.Offset(0, 1).Resize(, 26)
.Value = .Value

End With
End If
Next rCell
End With
Next wsSheet





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Eliminate formula Query

Yes there is a Reference checked titled "Autosave.xla". Does that mean I
have to enable Autosave on my PC in order for the macro to execute? The PC
which the file I'm working on is located does have Autosave turned on and
the small test file which I created on my PC and worked with the code has it
turned off

Thanks


"Tom Ogilvy" wrote in message
...
I don't see anything that would produce that error unless you go to
tools=References in the VBE with your workbook as the active project and
you see a reference marked as MISSING - that can cause that error in

unusual
situations.

if that isn't the case, try declaring the rcell variable

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
Dim rCell as Range

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I received this code a few months back that eliminates formulas in

certain
rows (Sales!A3:A55) where ever a certain date, which is is in C.O.S!H4,

then
just copy/paste values, those formulas that are in the cells. Code is as
below

Problem is that a highlighted "rCell" displays compile error shows up -
can't find project or libary.

I have tested the code on just on a blank file with basic data over 2
worksheets and it works fine - where have I gone wrong??

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
dTest = Worksheets("C.O.S").Range("H4").Value
For Each wsSheet In Sheets(Array("Sales"))
With wsSheet
For Each rCell In .Range("A3:A55")
If rCell.Value = dTest Then
With rCell.Offset(0, 1).Resize(, 26)
.Value = .Value

End With
End If
Next rCell
End With
Next wsSheet







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Eliminate formula Query

Having a reference checked isn't a problem unless it is marked as MISSING.
If it is, then that can cause problems or strange behavior.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Yes there is a Reference checked titled "Autosave.xla". Does that mean I
have to enable Autosave on my PC in order for the macro to execute? The PC
which the file I'm working on is located does have Autosave turned on and
the small test file which I created on my PC and worked with the code has

it
turned off

Thanks


"Tom Ogilvy" wrote in message
...
I don't see anything that would produce that error unless you go to
tools=References in the VBE with your workbook as the active project

and
you see a reference marked as MISSING - that can cause that error in

unusual
situations.

if that isn't the case, try declaring the rcell variable

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
Dim rCell as Range

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I received this code a few months back that eliminates formulas in

certain
rows (Sales!A3:A55) where ever a certain date, which is is in

C.O.S!H4,
then
just copy/paste values, those formulas that are in the cells. Code is

as
below

Problem is that a highlighted "rCell" displays compile error shows

up -
can't find project or libary.

I have tested the code on just on a blank file with basic data over 2
worksheets and it works fine - where have I gone wrong??

Public Sub SetupDatabase()
Dim wsSheet As Worksheet
Dim dTest As Double
dTest = Worksheets("C.O.S").Range("H4").Value
For Each wsSheet In Sheets(Array("Sales"))
With wsSheet
For Each rCell In .Range("A3:A55")
If rCell.Value = dTest Then
With rCell.Offset(0, 1).Resize(, 26)
.Value = .Value

End With
End If
Next rCell
End With
Next wsSheet









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
How to eliminate zero values on graphs when formula calculates 0? sjgolfer Charts and Charting in Excel 4 September 21st 09 07:26 PM
How would I eliminate the $0.00/column & keep formula Ro1 Excel Worksheet Functions 1 June 21st 09 03:06 AM
Eliminate #VALUE! in Formula Result Roy A. Excel Discussion (Misc queries) 4 March 15th 08 05:16 PM
Formula to Replace or eliminate any sheetname(s) in formula string EagleOne Excel Discussion (Misc queries) 0 September 20th 06 06:36 PM
What formula will eliminate the cell with #N/A when summing? Nunzio Excel Worksheet Functions 2 August 12th 06 06:21 PM


All times are GMT +1. The time now is 10:14 PM.

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"