Using a macro to create a sheet with a predefined name.

  • Thread starter Thread starter HoundofCullin
  • Start date Start date
H

HoundofCullin

I am unsure if this can be done. But I'm trying to get a macro that once
activated it creates a sheet with a name (any name other than the
-sheet1, sheet2, sheet3 etc-) and then pastes data from a cell into the
new sheet.

I can figure out just about everything EXCEPT how to get it to
automatically create the name for the sheet.
OR if you can tell me how to get it so that the sheet's don't get
created in a series than I can just creat a macro that changes the name
"sheet1" into something else... then when the macro is run again it
creates then renames sheet one once again.


Does this make anysense?


if you can help... I'ld be ever-so grateful
 
I'll bet you would learn how if you recorded a macro while you did it.
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 12/18/2003 by Don Guillett
'

'
Sheets.Add Type:="Worksheet"
Sheets("Sheet13").Select
Sheets("Sheet13").Name = "ggg"
End Sub
 
Not sure of what you want or need.
Using the following statement will name the active sheet whatever the
content of cell A1 is:
ActiveSheet.Name = Range("A1").Value

Please post back with more detail about what you have and what you want to
have. HTH Otto
 
Let's see if I can explain it... it all sounds good inside my skull...
but on screen I must appear daft.


I have a sheet that someone logs in outgoing trucks and it sorts thier
tonnage and the material they are hauling and the time they left etc.
in corrosponding columns.

Now the destination of these trucks are listed in another file. (which
is not really relevant to what I'm trying to accomplish at this
second)

Each destination is giving a job number.

As each truck departs the person who's logging them fills out the
correct criteria (tonnage etc.) And the destination (job number) goes
into a column called -Job #- oddly enough.

Multiple Jobs are logged on a single Truck Log.

My employer would like to be able to click a button (to which I will
have tied the macro I'm working on) and a certain the jobs will all get
their own sheets, named for the job number and the macro will file all
rows with the corresponding Job# into the appropriate sheets.



On a side note I tried to get him to use MS Access where he could then
sort the log by Job# without messing with the original trucklog... but
he's a tad bit stubborn.



Please let me know if that made anymore sense... if you need further
extrapolation on anything lemme know.

Thanks for the help givin' and hopefully to come :D
 
I know all you have said makes perfectly good sense to you but I also know
that you well realize that you are in the minority.
I think that your problem is relatively easy to solve. I think. But
not knowing anymore about it than I do I can't get my arms around it.
If you wish, do this: Make up a file and send it to me direct via
email. Remove "cobia97" from my email address.
In this file, clearly show what you have to start with (before this
macro you want fires). Then clearly show me what you want to have after the
macro has done it's thing. Then take me by the hand and explain to me how
you got from where you started to where you ended, one step at a time.
Between you and me, I'm sure we'll come up with what you need. Also
tell me what version of Excel you are using. HTH Otto
 
On a side note I tried to get him to use MS Access where he could then
sort the log by Job# without messing with the original trucklog... but
he's a tad bit stubborn.

So, why can't this be done in excel just using data>filter>autofilter or a
pivot table?

--
Don Guillett
SalesAid Software
(e-mail address removed)
HoundofCullin said:
Let's see if I can explain it... it all sounds good inside my skull...
but on screen I must appear daft.


I have a sheet that someone logs in outgoing trucks and it sorts thier
tonnage and the material they are hauling and the time they left etc.
in corrosponding columns.

Now the destination of these trucks are listed in another file. (which
is not really relevant to what I'm trying to accomplish at this
second)

Each destination is giving a job number.

As each truck departs the person who's logging them fills out the
correct criteria (tonnage etc.) And the destination (job number) goes
into a column called -Job #- oddly enough.

Multiple Jobs are logged on a single Truck Log.

My employer would like to be able to click a button (to which I will
have tied the macro I'm working on) and a certain the jobs will all get
their own sheets, named for the job number and the macro will file all
rows with the corresponding Job# into the appropriate sheets.



On a side note I tried to get him to use MS Access where he could then
sort the log by Job# without messing with the original trucklog... but
he's a tad bit stubborn.



Please let me know if that made anymore sense... if you need further
extrapolation on anything lemme know.

Thanks for the help givin' and hopefully to come :D

 
Back
Top