|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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:
and so on for each cell I would like to copy and insert this code before the 'Else' line? Regards, Sanjay |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Excel (2000) help with creating a macro |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|