Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 20th, 2003, 09:06 AM
sanj sanj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 100 sanj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 42 m 3 sec
Reputation Power: 6
Excel (2000) help with creating a macro

Hi,

The layout is:

Sheet name 'Resource'
Sheet name 'Master Spec'


In Resource,
I have 10 columns,

In Master Spec
I have a layout

What I would like to do is for each row except row 1 which is a header, is to create a copy of the Master Spec sheet naming the sheet from the resource sheet from cells say B & C, also I would like to copy some of the information into the newly created at relevant cells.

The way I look at it:

for (i=0, i<= lengthofnonblankcells in resourse sheet -1, i++)
create sheet
sheet name = resource[row+i column b]
Resource[row+i column b][cellA2]=resource[row+i column b]
etc,

end

Can someone please help

Regards,

Sanjay

Reply With Quote
  #2  
Old October 20th, 2003, 06:55 PM
galaganut galaganut is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 23 galaganut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 44 m 17 sec
Reputation Power: 0
Are the names of the "new" sheets in col B or C?

You could copy the Master Spec sheet and then rename it like this:

Code:
Sub CopySheet()
Sheets("Resource").Select
Selection.UsedRange.Select
LstRw= Selection.Rows.Count

'Loop until counter = LstRw
Set ctr = 1
Do
If ctr < LstRw Then
Sheets("Master Spec").Copy Before:=Sheets(1)
Sheets("Master Spec(2)").Name =  Sheets("Resource").Range("B" & ctr).Value
Else
End If
ctr = ctr + 1
Loop While ctr < LstRw

End Sub

I am hoping this can get you started.
Thanks,

Chuck

Last edited by galaganut : October 20th, 2003 at 06:59 PM.

Reply With Quote
  #3  
Old October 20th, 2003, 07:20 PM
sanj sanj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 100 sanj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 42 m 3 sec
Reputation Power: 6
Thanks Chuck,

I tried copy the macro but I get an error:

Complie Error:
Object required

The name is a combination of adding column C and D together.

Also, I think I can get to grips with placing the values from the resource sheet to the new sheet,



PHP Code:
 Worksheets("Resource List").Activate
ActiveCell
.Offset(02).Text
Selection
.Copy
Worksheets
("Master Spec(2)").Activate
Range
("J5").Select
ActiveSheet
.Paste 


and so on for each cell I would like to copy and insert this code before the 'Else' line?

Regards,

Sanjay

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Excel (2000) help with creating a macro


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway