#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rml rml is offline
external usenet poster
 
Posts: 50
Default Define Name

I have a defined NAME(e.g. GROUP1) of a group of Cells in a table. Within
this group of cells, I had defined another NAME (e.g. GROUP_1) for those
blank cells that I gathered. My problem is how to make dynamic changes on
the referred cells of GROUP_1, say if I place value in one blank cell, the
GROUP_1 will be updated.

GROUP1 : A1:J5
GROUP_1 : A2,J4 <BLANK CELLS

Editing the GROUP1, I delete the content of B1 and B2...
Hence, I need GROUP_1 to recognize the changes
GROUP_1 must be : A2,J4,B1,B2

I hope this is not another unsolved problem in our forum....

thanks a lot...
rml
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Define Name

Assuming that GROUP1 and GROUP_1 have already been defined. We need two
pieces of code:

1. worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("GROUP1")) Is Nothing Then
Else
Call main
End If
End Sub

so if any changes are madein GROUP1, main() is called

2. In a standard module:

Sub main()
Dim r As Range
Dim rr As Range
Dim s As String
With ActiveWorkbook
c = .Names.Count
If c 0 Then
For i = 1 To c
If .Names(i).Name = "GROUP_1" Then
.Names("GROUP_1").Delete
Exit For
End If
Next
End If
For Each r In Range("GROUP1")
If IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
s = rr.Address(ReferenceStyle:=xlR1C1)
MsgBox (s)
..Names.Add Name:="GROUP_1", RefersToR1C1:="=Sheet1!" & s
End With
End Sub

The code checks to see if GROUP_1 exists. If it exists, it is deleted. The
code then re-constructs GROUP_1 from scratch, UNIONing in empty cells. The
Named Range is then re-added to the workbook with the most current empty cell
set.
--
Gary's Student


"rml" wrote:

I have a defined NAME(e.g. GROUP1) of a group of Cells in a table. Within
this group of cells, I had defined another NAME (e.g. GROUP_1) for those
blank cells that I gathered. My problem is how to make dynamic changes on
the referred cells of GROUP_1, say if I place value in one blank cell, the
GROUP_1 will be updated.

GROUP1 : A1:J5
GROUP_1 : A2,J4 <BLANK CELLS

Editing the GROUP1, I delete the content of B1 and B2...
Hence, I need GROUP_1 to recognize the changes
GROUP_1 must be : A2,J4,B1,B2

I hope this is not another unsolved problem in our forum....

thanks a lot...
rml

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rml rml is offline
external usenet poster
 
Posts: 50
Default Define Name

CONGRATS...you're a wizard....hope u can generate more dynamic questions that
i will post sooner....thanks a lot.


"Gary''s Student" wrote:

Assuming that GROUP1 and GROUP_1 have already been defined. We need two
pieces of code:

1. worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("GROUP1")) Is Nothing Then
Else
Call main
End If
End Sub

so if any changes are madein GROUP1, main() is called

2. In a standard module:

Sub main()
Dim r As Range
Dim rr As Range
Dim s As String
With ActiveWorkbook
c = .Names.Count
If c 0 Then
For i = 1 To c
If .Names(i).Name = "GROUP_1" Then
.Names("GROUP_1").Delete
Exit For
End If
Next
End If
For Each r In Range("GROUP1")
If IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
s = rr.Address(ReferenceStyle:=xlR1C1)
MsgBox (s)
.Names.Add Name:="GROUP_1", RefersToR1C1:="=Sheet1!" & s
End With
End Sub

The code checks to see if GROUP_1 exists. If it exists, it is deleted. The
code then re-constructs GROUP_1 from scratch, UNIONing in empty cells. The
Named Range is then re-added to the workbook with the most current empty cell
set.
--
Gary's Student


"rml" wrote:

I have a defined NAME(e.g. GROUP1) of a group of Cells in a table. Within
this group of cells, I had defined another NAME (e.g. GROUP_1) for those
blank cells that I gathered. My problem is how to make dynamic changes on
the referred cells of GROUP_1, say if I place value in one blank cell, the
GROUP_1 will be updated.

GROUP1 : A1:J5
GROUP_1 : A2,J4 <BLANK CELLS

Editing the GROUP1, I delete the content of B1 and B2...
Hence, I need GROUP_1 to recognize the changes
GROUP_1 must be : A2,J4,B1,B2

I hope this is not another unsolved problem in our forum....

thanks a lot...
rml

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rml rml is offline
external usenet poster
 
Posts: 50
Default Define Name

Gary, could you extend help a little bit....
I forgot that I also have a defined name GROUP_2,within the GROUP1,which
contains values, How can we do dynamic change to GROUP_2... I dont know
VBE...thanks again.


"rml" wrote:

CONGRATS...you're a wizard....hope u can generate more dynamic questions that
i will post sooner....thanks a lot.


"Gary''s Student" wrote:

Assuming that GROUP1 and GROUP_1 have already been defined. We need two
pieces of code:

1. worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("GROUP1")) Is Nothing Then
Else
Call main
End If
End Sub

so if any changes are madein GROUP1, main() is called

2. In a standard module:

Sub main()
Dim r As Range
Dim rr As Range
Dim s As String
With ActiveWorkbook
c = .Names.Count
If c 0 Then
For i = 1 To c
If .Names(i).Name = "GROUP_1" Then
.Names("GROUP_1").Delete
Exit For
End If
Next
End If
For Each r In Range("GROUP1")
If IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
s = rr.Address(ReferenceStyle:=xlR1C1)
MsgBox (s)
.Names.Add Name:="GROUP_1", RefersToR1C1:="=Sheet1!" & s
End With
End Sub

The code checks to see if GROUP_1 exists. If it exists, it is deleted. The
code then re-constructs GROUP_1 from scratch, UNIONing in empty cells. The
Named Range is then re-added to the workbook with the most current empty cell
set.
--
Gary's Student


"rml" wrote:

I have a defined NAME(e.g. GROUP1) of a group of Cells in a table. Within
this group of cells, I had defined another NAME (e.g. GROUP_1) for those
blank cells that I gathered. My problem is how to make dynamic changes on
the referred cells of GROUP_1, say if I place value in one blank cell, the
GROUP_1 will be updated.

GROUP1 : A1:J5
GROUP_1 : A2,J4 <BLANK CELLS

Editing the GROUP1, I delete the content of B1 and B2...
Hence, I need GROUP_1 to recognize the changes
GROUP_1 must be : A2,J4,B1,B2

I hope this is not another unsolved problem in our forum....

thanks a lot...
rml

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Define Name

Tell me more about GROUP_2.
--
Gary's Student


"rml" wrote:

Gary, could you extend help a little bit....
I forgot that I also have a defined name GROUP_2,within the GROUP1,which
contains values, How can we do dynamic change to GROUP_2... I dont know
VBE...thanks again.


"rml" wrote:

CONGRATS...you're a wizard....hope u can generate more dynamic questions that
i will post sooner....thanks a lot.


"Gary''s Student" wrote:

Assuming that GROUP1 and GROUP_1 have already been defined. We need two
pieces of code:

1. worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("GROUP1")) Is Nothing Then
Else
Call main
End If
End Sub

so if any changes are madein GROUP1, main() is called

2. In a standard module:

Sub main()
Dim r As Range
Dim rr As Range
Dim s As String
With ActiveWorkbook
c = .Names.Count
If c 0 Then
For i = 1 To c
If .Names(i).Name = "GROUP_1" Then
.Names("GROUP_1").Delete
Exit For
End If
Next
End If
For Each r In Range("GROUP1")
If IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
s = rr.Address(ReferenceStyle:=xlR1C1)
MsgBox (s)
.Names.Add Name:="GROUP_1", RefersToR1C1:="=Sheet1!" & s
End With
End Sub

The code checks to see if GROUP_1 exists. If it exists, it is deleted. The
code then re-constructs GROUP_1 from scratch, UNIONing in empty cells. The
Named Range is then re-added to the workbook with the most current empty cell
set.
--
Gary's Student


"rml" wrote:

I have a defined NAME(e.g. GROUP1) of a group of Cells in a table. Within
this group of cells, I had defined another NAME (e.g. GROUP_1) for those
blank cells that I gathered. My problem is how to make dynamic changes on
the referred cells of GROUP_1, say if I place value in one blank cell, the
GROUP_1 will be updated.

GROUP1 : A1:J5
GROUP_1 : A2,J4 <BLANK CELLS

Editing the GROUP1, I delete the content of B1 and B2...
Hence, I need GROUP_1 to recognize the changes
GROUP_1 must be : A2,J4,B1,B2

I hope this is not another unsolved problem in our forum....

thanks a lot...
rml



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rml rml is offline
external usenet poster
 
Posts: 50
Default Define Name

e.g.
GROUP1 : A1:J10
GROUP_1 : blank cells within GROUP1
GROUP_2 : non-blank cells within GROUP1
GROUP1 = GROUP_1 + GROUP_2

thanks
rml


"Gary''s Student" wrote:

Tell me more about GROUP_2.
--
Gary's Student


"rml" wrote:

Gary, could you extend help a little bit....
I forgot that I also have a defined name GROUP_2,within the GROUP1,which
contains values, How can we do dynamic change to GROUP_2... I dont know
VBE...thanks again.


"rml" wrote:

CONGRATS...you're a wizard....hope u can generate more dynamic questions that
i will post sooner....thanks a lot.


"Gary''s Student" wrote:

Assuming that GROUP1 and GROUP_1 have already been defined. We need two
pieces of code:

1. worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("GROUP1")) Is Nothing Then
Else
Call main
End If
End Sub

so if any changes are madein GROUP1, main() is called

2. In a standard module:

Sub main()
Dim r As Range
Dim rr As Range
Dim s As String
With ActiveWorkbook
c = .Names.Count
If c 0 Then
For i = 1 To c
If .Names(i).Name = "GROUP_1" Then
.Names("GROUP_1").Delete
Exit For
End If
Next
End If
For Each r In Range("GROUP1")
If IsEmpty(r) Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
s = rr.Address(ReferenceStyle:=xlR1C1)
MsgBox (s)
.Names.Add Name:="GROUP_1", RefersToR1C1:="=Sheet1!" & s
End With
End Sub

The code checks to see if GROUP_1 exists. If it exists, it is deleted. The
code then re-constructs GROUP_1 from scratch, UNIONing in empty cells. The
Named Range is then re-added to the workbook with the most current empty cell
set.
--
Gary's Student


"rml" wrote:

I have a defined NAME(e.g. GROUP1) of a group of Cells in a table. Within
this group of cells, I had defined another NAME (e.g. GROUP_1) for those
blank cells that I gathered. My problem is how to make dynamic changes on
the referred cells of GROUP_1, say if I place value in one blank cell, the
GROUP_1 will be updated.

GROUP1 : A1:J5
GROUP_1 : A2,J4 <BLANK CELLS

Editing the GROUP1, I delete the content of B1 and B2...
Hence, I need GROUP_1 to recognize the changes
GROUP_1 must be : A2,J4,B1,B2

I hope this is not another unsolved problem in our forum....

thanks a lot...
rml

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
Formula via Define Name (not working) Edmund Excel Discussion (Misc queries) 3 May 16th 06 03:01 AM
define header cells nick Excel Discussion (Misc queries) 1 January 20th 06 07:54 PM
Define a chart using VBA Pim Charts and Charting in Excel 1 September 27th 05 10:57 PM
alternate UI for Define Names ?? jmg092548 Excel Discussion (Misc queries) 2 August 11th 05 01:32 PM
Define Name use in Macros Bill Christian Excel Discussion (Misc queries) 3 July 15th 05 03:43 AM


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