Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 270
Default How do I input these formulas into cells that I want written in?

If an employee input a dollar amount into G12, can I mandate he fill in what
the purpose was in A12? If he doesn't fill in the annotation in A12, then he
has to remove the dollar amount in G12 before proceeding with the rest of the
form. The highest dollar amount used in G12 would be $75.

Want dollar amount in G12
Want text in A12

I can make it work outside my cells with
Cell I formula
=IF(AND(G120,A12=""),"Error"," ")

Cell J formula
=IF(AND(G120,A12=""),"Need to fill out column A","OK")

How do I make it work inside my cells?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default How do I input these formulas into cells that I want written in?

Enter the following Event macro in the workshet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set r1 = Range("G12")
Set r2 = Range("A12")
If Intersect(r1, t) Is Nothing Then Exit Sub
If r2.Value < "" Then Exit Sub
Application.EnableEvents = False
t.Clear
r2.Select
Application.EnableEvents = True
MsgBox ("Enter a reason in A12")
End Sub



Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200822


"Paige" wrote:

If an employee input a dollar amount into G12, can I mandate he fill in what
the purpose was in A12? If he doesn't fill in the annotation in A12, then he
has to remove the dollar amount in G12 before proceeding with the rest of the
form. The highest dollar amount used in G12 would be $75.

Want dollar amount in G12
Want text in A12

I can make it work outside my cells with
Cell I formula
=IF(AND(G120,A12=""),"Error"," ")

Cell J formula
=IF(AND(G120,A12=""),"Need to fill out column A","OK")

How do I make it work inside my cells?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default How do I input these formulas into cells that I want written in?

You cannot put a formula into either A12 or G12 since this is where you want
to enter data.
I would use conditional formatting. Select A12 and open the Conditional
Formatting dialog; use the formula =AND(G1212, ISBLANK(A12) and set a
bright red fill colour.

For the $75 limit on G12 use Data Validation

If you need help with either topic, please return
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Paige" wrote in message
...
If an employee input a dollar amount into G12, can I mandate he fill in
what
the purpose was in A12? If he doesn't fill in the annotation in A12, then
he
has to remove the dollar amount in G12 before proceeding with the rest of
the
form. The highest dollar amount used in G12 would be $75.

Want dollar amount in G12
Want text in A12

I can make it work outside my cells with
Cell I formula
=IF(AND(G120,A12=""),"Error"," ")

Cell J formula
=IF(AND(G120,A12=""),"Need to fill out column A","OK")

How do I make it work inside my cells?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 270
Default How do I input these formulas into cells that I want written i

I was able to get this line to work. It is what I wanted.

I have read the links you told me to read. I can't figure out how to make
several lines do the same thing.

I need this same code from
G12 and A12
to
G41 and A41




"Gary''s Student" wrote:

Enter the following Event macro in the workshet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set r1 = Range("G12")
Set r2 = Range("A12")
If Intersect(r1, t) Is Nothing Then Exit Sub
If r2.Value < "" Then Exit Sub
Application.EnableEvents = False
t.Clear
r2.Select
Application.EnableEvents = True
MsgBox ("Enter a reason in A12")
End Sub



Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm


--
Gary''s Student - gsnu200822


"Paige" wrote:

If an employee input a dollar amount into G12, can I mandate he fill in what
the purpose was in A12? If he doesn't fill in the annotation in A12, then he
has to remove the dollar amount in G12 before proceeding with the rest of the
form. The highest dollar amount used in G12 would be $75.

Want dollar amount in G12
Want text in A12

I can make it work outside my cells with
Cell I formula
=IF(AND(G120,A12=""),"Error"," ")

Cell J formula
=IF(AND(G120,A12=""),"Need to fill out column A","OK")

How do I make it work inside my cells?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 270
Default How do I input these formulas into cells that I want written i

I can't get this one to work on the first line.



"Bernard Liengme" wrote:

You cannot put a formula into either A12 or G12 since this is where you want
to enter data.
I would use conditional formatting. Select A12 and open the Conditional
Formatting dialog; use the formula =AND(G1212, ISBLANK(A12) and set a
bright red fill colour.

For the $75 limit on G12 use Data Validation

If you need help with either topic, please return
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Paige" wrote in message
...
If an employee input a dollar amount into G12, can I mandate he fill in
what
the purpose was in A12? If he doesn't fill in the annotation in A12, then
he
has to remove the dollar amount in G12 before proceeding with the rest of
the
form. The highest dollar amount used in G12 would be $75.

Want dollar amount in G12
Want text in A12

I can make it work outside my cells with
Cell I formula
=IF(AND(G120,A12=""),"Error"," ")

Cell J formula
=IF(AND(G120,A12=""),"Need to fill out column A","OK")

How do I make it work inside my cells?





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
Automatically use the newest number input in the formulas JessieB Excel Discussion (Misc queries) 1 January 11th 08 07:38 PM
how to account the number of cells which is bank and written? jack Excel Discussion (Misc queries) 1 May 8th 07 05:22 PM
Quickest way to input formulas? Aoife101 Excel Discussion (Misc queries) 2 July 20th 06 01:46 PM
Hidden rows unhide themselves when formulas are written Hongch Excel Discussion (Misc queries) 3 January 19th 06 06:33 PM
Formulas containing variable input ym4life Excel Discussion (Misc queries) 5 August 16th 05 01:07 PM


All times are GMT +1. The time now is 05:50 PM.

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"