![]() |
#6
|
|||
|
|||
![]() Quote:
Here is the code for the workbook Code:
Sub WedData() ' Macro recorded 9/15/2013 by JRErickson ' Dim WedDate As Date Dim WedColTot As Integer Dim CurCol As String Dim CurRange As String Range("'Print Out'!y1:z500").ClearContents Range("'Print Out'!b4").ClearContents Range("'Print Out'!d3").ClearContents Range("a1").Select WedDate = InputBox("Please enter Wednesday date in proper format.", "Enter Date") Cells.Find(What:=WedDate, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate ActiveCell.Offset(1, 0).Select CurCell = ActiveCell.Column y = 8 For X = 1 To 104 If ActiveCell.Value <> "" Then Range("'Print Out'!Z" & y) = ActiveCell.Value Range("'Print Out'!Y" & y) = Cells(y, 2) y = y + 1 ActiveCell.Offset(1, 0).Select Else ActiveCell.Offset(1, 0).Select End If Next X Range("'Print Out'!b4").Value = WedDate Range("'Print Out'!d3").Value = "Wednesday" Range("a3").Select End Sub Sub SatData() ' Macro recorded 9/15/2013 by JRErickson ' Dim SatDate As Date Dim SatColTot As Integer Dim CurCol As String Dim CurRange As String Range("'Print Out'!y1:z500").ClearContents Range("'Print Out'!b4").ClearContents Range("'Print Out'!d3").ClearContents Range("a1").Select SatDate = InputBox("Please enter Saturday date in proper format.", "Enter Date") Cells.Find(What:=SatDate, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate ActiveCell.Offset(1, 0).Select CurCell = ActiveCell.Column y = 8 For X = 1 To 179 If ActiveCell.Value <> "" Then Range("'Print Out'!Z" & y) = ActiveCell.Value Range("'Print Out'!Y" & y) = Cells(y, 2) y = y + 1 ActiveCell.Offset(1, 0).Select Else ActiveCell.Offset(1, 0).Select End If Next X Range("'Print Out'!b4").Value = SatDate Range("'Print Out'!d3").Value = "Saturday" Range("a3").Select End Sub This was fun. Let me know what you think or if you have any questions. Take care. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ragesz | Word Tables | 1 | 09-29-2013 06:14 PM |
converting a word document to a data file for mail merge | drsuis | Mail Merge | 4 | 02-21-2013 03:34 PM |
![]() |
navysalad | Mail Merge | 6 | 01-07-2012 06:50 PM |
![]() |
daym | Publisher | 2 | 05-01-2011 03:45 AM |
How do I set up the fields in mail merge word 07 from my data base | mbcrabber | Mail Merge | 4 | 06-06-2010 01:25 PM |