Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

In a worksheet where you have to fill in information what formula to use if
you want to make sure (example cell A1 is filled in before A2) In other words
they if A1 is not filled in you cant move to A2.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Entering information

To make sure A1 is filled before A2

1. Select A2

2. Enter the below formula in DataValidationCustom and uncheck Ignore blank
=$A$1<""

3. Enter an error message say "Cells A1 should be entered firts" in Data
ValidationError Alert....and click OK.

If this post helps click Yes
---------------
Jacob Skaria


"Link" wrote:

In a worksheet where you have to fill in information what formula to use if
you want to make sure (example cell A1 is filled in before A2) In other words
they if A1 is not filled in you cant move to A2.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information


Hi Jacob,
The formula worked for one worksheet, but the other one already have a data
validation formula and it did not worked. Any other suggestion?
"Jacob Skaria" wrote:

To make sure A1 is filled before A2

1. Select A2

2. Enter the below formula in DataValidationCustom and uncheck Ignore blank
=$A$1<""

3. Enter an error message say "Cells A1 should be entered firts" in Data
ValidationError Alert....and click OK.

If this post helps click Yes
---------------
Jacob Skaria


"Link" wrote:

In a worksheet where you have to fill in information what formula to use if
you want to make sure (example cell A1 is filled in before A2) In other words
they if A1 is not filled in you cant move to A2.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Entering information

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.




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

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link
wrote:

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

This is what I need the information to apply only certain cells; not every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link
wrote:

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Entering information

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link
wrote:

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link
wrote:

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Entering information

Having dinner and Hockey Game...........Go Pens!

Probably tomorrow after early morning round of golf before I can get back to
this.

Maybe Patrick is free before then<g


Gord

On Tue, 2 Jun 2009 16:40:02 -0700, Link
wrote:

Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link
wrote:

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.








  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

Enjoy your evening! I really appreciate you helping me. Tomorrow will be fine.

"Gord Dibben" wrote:

Having dinner and Hockey Game...........Go Pens!

Probably tomorrow after early morning round of golf before I can get back to
this.

Maybe Patrick is free before then<g


Gord

On Tue, 2 Jun 2009 16:40:02 -0700, Link
wrote:

Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link
wrote:

I am confused. After I click on view code where do I type all this information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what formula to use
if
you want to make sure (example cell A1 is filled in before A2) In other
words
they if A1 is not filled in you cant move to A2.







  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Entering information

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on? the
other ranges are aon the same row, so their dependency is on the row above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2) In
other
words
they if A1 is not filled in you cant move to A2.





  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Entering information

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on? the
other ranges are aon the same row, so their dependency is on the row above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2) In
other
words
they if A1 is not filled in you cant move to A2.





  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

I have more than one worksheets. For this worksheet I need cell C2 to N4 to
be fill in ordercell c2, then cell J2, then k3, then cell D4, than cell n4.
after that it goes to F8, then F11, then G8, then G11, then H8 then
H11.......to O8 then O11. Sorry for the confusion.

"Patrick Molloy" wrote:

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on? the
other ranges are aon the same row, so their dependency is on the row above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2) In
other
words
they if A1 is not filled in you cant move to A2.






  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

I have more than one worksheets. For this worksheet I need cell C2 to N4 to
be fill in ordercell c2, then cell J2, then k3, then cell D4, than cell n4.
after that it goes to F8, then F11, then G8, then G11, then H8 then
H11.......to O8 then O11. Sorry for the confusion.

"Patrick Molloy" wrote:

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on? the
other ranges are aon the same row, so their dependency is on the row above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this is
the first with this other set them F:8:O8 and f11:O11. I need to fill f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link
wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2) In
other
words
they if A1 is not filled in you cant move to A2.








  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Entering information

not confused at all - but you're feeding more and more into the question

the worksheet change event is in the code behind the sheet
so if you have different cells on other sheets, just copy the code to each
sheets' code page and amend the CONST appropriately.



"Link" wrote in message
...
I have more than one worksheets. For this worksheet I need cell C2 to N4
to
be fill in ordercell c2, then cell J2, then k3, then cell D4, than cell
n4.
after that it goes to F8, then F11, then G8, then G11, then H8 then
H11.......to O8 then O11. Sorry for the confusion.

"Patrick Molloy" wrote:

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on?
the
other ranges are aon the same row, so their dependency is on the row
above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same
row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this
is
the first with this other set them F:8:O8 and f11:O11. I need to fill
f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link

wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of
the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2)
In
other
words
they if A1 is not filled in you cant move to A2.






  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Entering information

not confused at all - but you're feeding more and more into the question

the worksheet change event is in the code behind the sheet
so if you have different cells on other sheets, just copy the code to each
sheets' code page and amend the CONST appropriately.



"Link" wrote in message
...
I have more than one worksheets. For this worksheet I need cell C2 to N4
to
be fill in ordercell c2, then cell J2, then k3, then cell D4, than cell
n4.
after that it goes to F8, then F11, then G8, then G11, then H8 then
H11.......to O8 then O11. Sorry for the confusion.

"Patrick Molloy" wrote:

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on?
the
other ranges are aon the same row, so their dependency is on the row
above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same
row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this
is
the first with this other set them F:8:O8 and f11:O11. I need to fill
f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link

wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of
the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2)
In
other
words
they if A1 is not filled in you cant move to A2.






  #18   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

Hi Patrick,

Maybe I am doing something wrong with this workbook. I did other workbook
with simpler formula and they worked, but this one is not working. I just
have to leave it.
I am just not understanding it.

Thanks for your help.

"Patrick Molloy" wrote:

not confused at all - but you're feeding more and more into the question

the worksheet change event is in the code behind the sheet
so if you have different cells on other sheets, just copy the code to each
sheets' code page and amend the CONST appropriately.



"Link" wrote in message
...
I have more than one worksheets. For this worksheet I need cell C2 to N4
to
be fill in ordercell c2, then cell J2, then k3, then cell D4, than cell
n4.
after that it goes to F8, then F11, then G8, then G11, then H8 then
H11.......to O8 then O11. Sorry for the confusion.

"Patrick Molloy" wrote:

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on?
the
other ranges are aon the same row, so their dependency is on the row
above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same
row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this
is
the first with this other set them F:8:O8 and f11:O11. I need to fill
f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link

wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of
the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2)
In
other
words
they if A1 is not filled in you cant move to A2.






  #19   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Entering information

Hi Patrick,

Maybe I am doing something wrong with this workbook. I did other workbook
with simpler formula and they worked, but this one is not working. I just
have to leave it.
I am just not understanding it.

Thanks for your help.

"Patrick Molloy" wrote:

not confused at all - but you're feeding more and more into the question

the worksheet change event is in the code behind the sheet
so if you have different cells on other sheets, just copy the code to each
sheets' code page and amend the CONST appropriately.



"Link" wrote in message
...
I have more than one worksheets. For this worksheet I need cell C2 to N4
to
be fill in ordercell c2, then cell J2, then k3, then cell D4, than cell
n4.
after that it goes to F8, then F11, then G8, then G11, then H8 then
H11.......to O8 then O11. Sorry for the confusion.

"Patrick Molloy" wrote:

initial request was for row 2...if the cells above, in row 1 were empty,
then raise the messsage

now you give a range of C2:N4
how does this work? is C2 dependent on C1 and then C3 on C2 and so on?
the
other ranges are aon the same row, so their dependency is on the row
above i
guess.

I'm assuming C2:N4 really should have been C4:N4 --- all in the same
row
for consistency. If this isn't the case, then we can revisit...

so the change is minimal
this
Const WS_RANGE As String = "A2:F2"
to this
Const WS_RANGE As String = "A2:F2,C4:N4,F8:O8,F11:O11"


"Link" wrote in message
...
Hi sorry to be a bother; suppose I have three ranges example c2:n4 this
is
the first with this other set them F:8:O8 and f11:O11. I need to fill
f8
them F11 after G8 then G11 then H8 then H11 etc. ( I want the colum in
order)


"Gord Dibben" wrote:

Patrick's code points only to A1 and A2, not "all cells"

Which cells would you like to see included?

Try editing this to suit or post back with some specifics.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cell As Range
Const WS_RANGE As String = "A2:F2"
Application.EnableEvents = False
On Error Resume Next
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each Cell In Intersect(Target, Me.Range(WS_RANGE)).Cells
With Cell.Offset(-1, 0)
If .Value = "" Then
MsgBox .Address & " is empty"
End If
End With
Next
End If
On Error GoTo 0
Application.EnableEvents = True
End Sub


Gord

On Tue, 2 Jun 2009 15:35:01 -0700, Link

wrote:

This is what I need the information to apply only certain cells; not
every
cells. Is this possible?

"Gord Dibben" wrote:

You don't type anything.

Copy from Patrick's post and paste into the blank white space of
the
module
that opens when you right-click and "View Code".


Gord Dibben MS Excel MVP

On Tue, 2 Jun 2009 14:55:15 -0700, Link

wrote:

I am confused. After I click on view code where do I type all this
information?

"Patrick Molloy" wrote:

use the sheet's change method ....right click the sheet tab and
select View
Code from the pop-up menu

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("a2").Address Then
If Range("a1") = "" Then
MsgBox "A1 is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub


"Link" wrote in message
...
In a worksheet where you have to fill in information what
formula to use
if
you want to make sure (example cell A1 is filled in before A2)
In
other
words
they if A1 is not filled in you cant move to A2.






  #20   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Entering information

You need to apply this for each worksheet.
--
If this post helps click Yes
---------------
Jacob Skaria


"Link" wrote:


Hi Jacob,
The formula worked for one worksheet, but the other one already have a data
validation formula and it did not worked. Any other suggestion?
"Jacob Skaria" wrote:

To make sure A1 is filled before A2

1. Select A2

2. Enter the below formula in DataValidationCustom and uncheck Ignore blank
=$A$1<""

3. Enter an error message say "Cells A1 should be entered firts" in Data
ValidationError Alert....and click OK.

If this post helps click Yes
---------------
Jacob Skaria


"Link" wrote:

In a worksheet where you have to fill in information what formula to use if
you want to make sure (example cell A1 is filled in before A2) In other words
they if A1 is not filled in you cant move to A2.

  #21   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Entering information

You need to apply this for each worksheet.
--
If this post helps click Yes
---------------
Jacob Skaria


"Link" wrote:


Hi Jacob,
The formula worked for one worksheet, but the other one already have a data
validation formula and it did not worked. Any other suggestion?
"Jacob Skaria" wrote:

To make sure A1 is filled before A2

1. Select A2

2. Enter the below formula in DataValidationCustom and uncheck Ignore blank
=$A$1<""

3. Enter an error message say "Cells A1 should be entered firts" in Data
ValidationError Alert....and click OK.

If this post helps click Yes
---------------
Jacob Skaria


"Link" wrote:

In a worksheet where you have to fill in information what formula to use if
you want to make sure (example cell A1 is filled in before A2) In other words
they if A1 is not filled in you cant move to A2.

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 do I populate a cell when entering information into another? Netty Excel Discussion (Misc queries) 1 February 4th 10 04:35 AM
Automatic entering of information from another worksheet if given leigh10427 Excel Worksheet Functions 0 February 12th 09 02:28 PM
Entering Information Into Another Column Té Excel Discussion (Misc queries) 2 June 25th 08 05:16 PM
Entering information from 1 worksheet to another, if criteria is m Victoria Excel Discussion (Misc queries) 8 May 22nd 06 02:47 AM
Entering Excel information into MS Word dwalsh77 Excel Discussion (Misc queries) 0 April 8th 05 05:29 PM


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