Need help coping excel date to sheets

Microsoft Office excel 2007
November 16, 2010 at 11:30:29
Specs: Windows XP Professional, 1.73 GHz, 2GB Ram
I have a master sheet with headings and columns that is used to input date from samples taken. I have a macro that has created sheets for the entire month and changed the tab names (i.e., Friday, 11-12-2010), so i'll have a workbook for each month. However, I need the master sheet (form data) copied into the existing sheets (day/date sheets) so that data can be completed in those sheets each day.

Any help would be greatly appreciated. Thanks, David


See More: Need help coping excel date to sheets

Report •

#1
November 16, 2010 at 12:17:57
re: "I need the master sheet (form data) copied into the existing sheets (day/date sheets) so that data can be completed in those sheets each day.

Since we can't see your workbook from where we're sitting, nor can we read minds, there's no way we can offer any assisitance without more information.

You need to tell how the sheets are laid out and what you want copied to where before we can help you.

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

#2
November 16, 2010 at 12:32:28
My master sheet is basic: 4 colums with heading (weight, length, width, and thickness) the person inputs the numbers in the colums. When I run the existing macro from the master sheet to make mutiple sheets for days of the month the headings, formatted columns stay with the master sheet and do not copy to the rest of the day sheets. The macro that I am currently run to make the other sheets is:
Sub Macro1()
'Dim J As Integer
Dim K As Integer
Dim sDay As String
Dim sTemp As String
Dim iTarget As Integer
Dim dBasis As Date

iTarget = 13
While (iTarget < 1) Or (iTarget > 12)
iTarget = Val(InputBox("Numeric month?"))
If iTarget = 0 Then Exit Sub
Wend

Application.ScreenUpdating = False
sTemp = Str(iTarget) & "/1/" & Year(Now())
dBasis = CDate(sTemp)

For J = 1 To 31
sDay = Format((dBasis + J - 1), "dddd mm-dd-yyyy")
If Month(dBasis + J - 1) = iTarget Then

If J <= Sheets.Count Then
If Left(Sheets(J).Name, 5) = "Sheet" Then
Sheets(J).Name = sDay
Else
Sheets.Add.Move after:=Sheets(Sheets.Count)
ActiveSheet.Name = sDay
End If
Else
Sheets.Add.Move after:=Sheets(Sheets.Count)
ActiveSheet.Name = sDay
End If
End If
Next J

For J = 1 To (Sheets.Count - 1)
For K = J + 1 To Sheets.Count
If Right(Sheets(J).Name, 10) > _
Right(Sheets(K).Name, 10) Then
Sheets(K).Move Before:=Sheets(J)
End If
Next K
Next J

Sheets(1).Activate
Application.ScreenUpdating = True

'
End Sub


Report •

#3
November 16, 2010 at 16:06:43
Perhaps you missed the last line of my first response.

We'll try it again:

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

Related Solutions

#4
November 17, 2010 at 05:02:33
Like I said, the sheet is very basic: laid out with columns for someone else to input data. A1 to K1000. They input data into columns A, C, D, E G, I J and K. Heading are as follows:

Raw Tenderloins Marinated Tenderloins
Weight Weight Length Width Thickness
(Grams) (Ounces) (Inches) (Inches) (Inches)
The operator inputs the weight in a sheet (up to 1000 samples taken) for that date. I just need A1 to K1000 copied to all pages, would like to add it to the macro above.

Hope this helps. thanks, David



Report •

#5
November 17, 2010 at 20:33:50
Like I said...

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

#6
November 18, 2010 at 06:05:35
I am very sorry, I don't know how to make it any simpler for you. All I need is to copy cells A1 to K1000 to all sheets in the workbook. Would like to add it to the macro that I have that makes a sheet for everyday of the month. So when you run the macro the workbook would contain all the sheets for the month and the exact copy of the data would also be populated to all sheets. If the above is not in the most simplest form then I need you to be more specific as what you would like as I can't place my workbook on this site (or can I?). Thanks again.

Report •

#7
November 18, 2010 at 12:34:26
I got it from another expert on another site on the first try. This is all I wanted:

Sub Macro6()
Dim sh As Worksheet, sh1 As Worksheet
Set sh = Worksheets(1)
For Each sh1 In Worksheets
If sh1.Name <> sh.Name Then
sh.Range("A1:K1").EntireColumn.Copy _
sh1.Range("A1:K1").EntireColumn
End If
Next
End Sub


Report •

#8
November 18, 2010 at 14:14:07
re: I am very sorry, I don't know how to make it any simpler for you

I never asked you to make it any simpler for me. In fact, I understood exactly what you were trying to do.

All I asked for - repeatedly - was that you read the How To that I supplied the link to.

The How To had nothing to do with what you were trying to accomplish, but had everything to do with the proper way to post code on this site.

I see that by your last response, you still haven't read the How to.

Had you read it - and followed the instructions - your lastest post would have looked something like this:

 Sub Macro6()
 Dim sh As Worksheet, sh1 As Worksheet
   Set sh = Worksheets(1)
    For Each sh1 In Worksheets
       If sh1.Name <> sh.Name Then
         sh.Range("A1:K1").EntireColumn.Copy _
            sh1.Range("A1:K1").EntireColumn
       End If
    Next
 End Sub

Which piece of code do you find easier to follow - the code in this post, or the code in your last response?

When writing code, indents are used to set different sections of instructions apart from each other so that the code is easier for the reader to follow. You can tell what is inside the If-Then section, which in turn is inside the For-Next loop, etc.

The only way for those indents to show up in a post is if you follow the instructions in the How To that you can get to by clicking the How To link in the next line.

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

Ask Question