Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default help with macro

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default help with macro

I got it to work with no changes. Before putting the formula into worksheet
make sure C3 is empty. Highlight the cell where you want the formula and
then paste the forula at the top of the worksheet in the fx box (formmula
box). It shuold work.

"hannatrip" wrote:

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default help with macro

it works that way, but i cant get it to lock and im afraid when one of the
unit clerks makes a mistake and deletes it it will lose it all. orr what am I
doing wrong in locking the cell with the formula in it??

"Joel" wrote:

I got it to work with no changes. Before putting the formula into worksheet
make sure C3 is empty. Highlight the cell where you want the formula and
then paste the forula at the top of the worksheet in the fx box (formmula
box). It shuold work.

"hannatrip" wrote:

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default help with macro

This function gave me the same answerr as the worksheett function

Function GetGest(cell As Range)

If IsEmpty(cell) Then
GetGest = ""
Else

GetGest = 40 - ((cell - Date) / 7)

End If

End Function




"hannatrip" wrote:

it works that way, but i cant get it to lock and im afraid when one of the
unit clerks makes a mistake and deletes it it will lose it all. orr what am I
doing wrong in locking the cell with the formula in it??

"Joel" wrote:

I got it to work with no changes. Before putting the formula into worksheet
make sure C3 is empty. Highlight the cell where you want the formula and
then paste the forula at the top of the worksheet in the fx box (formmula
box). It shuold work.

"hannatrip" wrote:

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default help with macro

Thank you!!

"Joel" wrote:

This function gave me the same answerr as the worksheett function

Function GetGest(cell As Range)

If IsEmpty(cell) Then
GetGest = ""
Else

GetGest = 40 - ((cell - Date) / 7)

End If

End Function




"hannatrip" wrote:

it works that way, but i cant get it to lock and im afraid when one of the
unit clerks makes a mistake and deletes it it will lose it all. orr what am I
doing wrong in locking the cell with the formula in it??

"Joel" wrote:

I got it to work with no changes. Before putting the formula into worksheet
make sure C3 is empty. Highlight the cell where you want the formula and
then paste the forula at the top of the worksheet in the fx box (formmula
box). It shuold work.

"hannatrip" wrote:

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default help with macro

By default, all cells are protected when sheet protection is enabled.

Hit CTRL + a(twice in 2003) to select all cells.

FormatCellsProtection. Uncheck "locked"

Select the cells you want protected and FormatCellsProtection

Check "locked".

ToolsProtectionProtect Sheet. Note the options when protecting.

Supply a password and OK.

Excel's internal security is weak but this will prevent overwriting by accident.


Gord Dibben MS Excel MVP

On Wed, 14 Mar 2007 11:51:32 -0700, hannatrip
wrote:

it works that way, but i cant get it to lock and im afraid when one of the
unit clerks makes a mistake and deletes it it will lose it all. orr what am I
doing wrong in locking the cell with the formula in it??

"Joel" wrote:

I got it to work with no changes. Before putting the formula into worksheet
make sure C3 is empty. Highlight the cell where you want the formula and
then paste the forula at the top of the worksheet in the fx box (formmula
box). It shuold work.

"hannatrip" wrote:

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default help with macro

Thanks you, I finally got it to work!

"Gord Dibben" wrote:

By default, all cells are protected when sheet protection is enabled.

Hit CTRL + a(twice in 2003) to select all cells.

FormatCellsProtection. Uncheck "locked"

Select the cells you want protected and FormatCellsProtection

Check "locked".

ToolsProtectionProtect Sheet. Note the options when protecting.

Supply a password and OK.

Excel's internal security is weak but this will prevent overwriting by accident.


Gord Dibben MS Excel MVP

On Wed, 14 Mar 2007 11:51:32 -0700, hannatrip
wrote:

it works that way, but i cant get it to lock and im afraid when one of the
unit clerks makes a mistake and deletes it it will lose it all. orr what am I
doing wrong in locking the cell with the formula in it??

"Joel" wrote:

I got it to work with no changes. Before putting the formula into worksheet
make sure C3 is empty. Highlight the cell where you want the formula and
then paste the forula at the top of the worksheet in the fx box (formmula
box). It shuold work.

"hannatrip" wrote:

I would like to make a macro with the following formula
=IF(C3="","",((40-((C3-(TODAY())))/7)))
it needs to calculate a gestational age when the due date is put in from L5
to L169..

I cant seem to get it to lock so the formula doesnt get deleted so I thought
a macro would work??



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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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