Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default I think I have an array question...

I have a workbook that starts off with two worksheets. The first worksheet is
called "Data" and the second worksheet is call "results". In column A rows 1
through XXX (undertermined number of rows) I have a list of product names. I
would like to kick off a procedure after all of the product names are entered
that would copy each of those names to a copy of the "results" sheet in cell
D7. Can someone give me some help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default I think I have an array question...

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
next
End sub

--
Regards,
Tom Ogilvy


"hshayh0rn" wrote:

I have a workbook that starts off with two worksheets. The first worksheet is
called "Data" and the second worksheet is call "results". In column A rows 1
through XXX (undertermined number of rows) I have a list of product names. I
would like to kick off a procedure after all of the product names are entered
that would copy each of those names to a copy of the "results" sheet in cell
D7. Can someone give me some help?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default I think I have an array question...

Thanks Tom! That worked well except it did not put the name of the product in
D7. It names the sheet correctly though.

"Tom Ogilvy" wrote:

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
next
End sub

--
Regards,
Tom Ogilvy


"hshayh0rn" wrote:

I have a workbook that starts off with two worksheets. The first worksheet is
called "Data" and the second worksheet is call "results". In column A rows 1
through XXX (undertermined number of rows) I have a list of product names. I
would like to kick off a procedure after all of the product names are entered
that would copy each of those names to a copy of the "results" sheet in cell
D7. Can someone give me some help?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default I think I have an array question...

Maybe ...

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
activesheet.range("D7").value = cell.value
next
End sub

hshayh0rn wrote:

Thanks Tom! That worked well except it did not put the name of the product in
D7. It names the sheet correctly though.

"Tom Ogilvy" wrote:

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
next
End sub

--
Regards,
Tom Ogilvy


"hshayh0rn" wrote:

I have a workbook that starts off with two worksheets. The first worksheet is
called "Data" and the second worksheet is call "results". In column A rows 1
through XXX (undertermined number of rows) I have a list of product names. I
would like to kick off a procedure after all of the product names are entered
that would copy each of those names to a copy of the "results" sheet in cell
D7. Can someone give me some help?


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default I think I have an array question...

I missed that requirement:

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
Activesheet.Range("D7").Value = cell.Value
next
End sub

--
Regards,
Tom Ogilvy



"hshayh0rn" wrote:

Thanks Tom! That worked well except it did not put the name of the product in
D7. It names the sheet correctly though.

"Tom Ogilvy" wrote:

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
next
End sub

--
Regards,
Tom Ogilvy


"hshayh0rn" wrote:

I have a workbook that starts off with two worksheets. The first worksheet is
called "Data" and the second worksheet is call "results". In column A rows 1
through XXX (undertermined number of rows) I have a list of product names. I
would like to kick off a procedure after all of the product names are entered
that would copy each of those names to a copy of the "results" sheet in cell
D7. Can someone give me some help?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default I think I have an array question...

Thanks Tom and Dave. Problem solved!

"Tom Ogilvy" wrote:

I missed that requirement:

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
Activesheet.Range("D7").Value = cell.Value
next
End sub

--
Regards,
Tom Ogilvy



"hshayh0rn" wrote:

Thanks Tom! That worked well except it did not put the name of the product in
D7. It names the sheet correctly though.

"Tom Ogilvy" wrote:

sub Addsheets
Dim cell as Range, rng as Range
with worksheets("Data")
set rng = .Range(.Cells(2,1),.cells(2,1).End(xldown))
end with
for each cell in rng
worksheets("Results").copy After:=worksheets(worksheets.count)
Activesheet.name = cell
next
End sub

--
Regards,
Tom Ogilvy


"hshayh0rn" wrote:

I have a workbook that starts off with two worksheets. The first worksheet is
called "Data" and the second worksheet is call "results". In column A rows 1
through XXX (undertermined number of rows) I have a list of product names. I
would like to kick off a procedure after all of the product names are entered
that would copy each of those names to a copy of the "results" sheet in cell
D7. Can someone give me some help?

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
Array Question Frederick Chow Excel Programming 3 March 10th 05 06:16 PM
Array question mickiedevries[_9_] Excel Programming 3 August 24th 04 06:58 PM
Array Question hotherps[_88_] Excel Programming 2 July 30th 04 11:26 AM
vba array question chick-racer[_30_] Excel Programming 4 November 10th 03 05:59 PM
array question john petty Excel Programming 1 August 29th 03 04:57 PM


All times are GMT +1. The time now is 03:01 AM.

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"