xfr79
12-31-2008, 02:38 PM
I'm trying to add a section to this script below. What I want it to do is add a cell data from the worksheet that was created.
The way the script works, it asks for a month digit, day digit, and year digits. It then makes a copy of sheet "BACKLOG" and renames the sheet with the data the user put in for the month, day and year digits. (1.1.09)
What I then want to do after that is done is to go to sheet "TABLE" and find the next available row with no data, and add a cell link to certain cells in each row column. I've tagged the script below to indicate the cells being linked.
Private Sub CommandButton1_Click()
Unload Me
Sheets("BACKLOG").Visible = True
Worksheets("BACKLOG").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = monthoutput & "." & dayoutput & "." & yearoutput
On Error Resume Next
On Error GoTo 0
Range("A1").Select
' **********************************************
Select next available row with no data.
Column A
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "I1")
Column B
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "J30")
Column C
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "J14")
Column D
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "I7")
' **********************************************
Sheets("BACKLOG").Select
ActiveWindow.SelectedSheets.Visible = False
Application.Run "dvtosort"
Application.Run "dvto"
End Sub
The way the script works, it asks for a month digit, day digit, and year digits. It then makes a copy of sheet "BACKLOG" and renames the sheet with the data the user put in for the month, day and year digits. (1.1.09)
What I then want to do after that is done is to go to sheet "TABLE" and find the next available row with no data, and add a cell link to certain cells in each row column. I've tagged the script below to indicate the cells being linked.
Private Sub CommandButton1_Click()
Unload Me
Sheets("BACKLOG").Visible = True
Worksheets("BACKLOG").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = monthoutput & "." & dayoutput & "." & yearoutput
On Error Resume Next
On Error GoTo 0
Range("A1").Select
' **********************************************
Select next available row with no data.
Column A
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "I1")
Column B
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "J30")
Column C
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "J14")
Column D
(add a cell link to the sheet created. =monthoutput & "." & dayoutput & "." & yearoutput & "I7")
' **********************************************
Sheets("BACKLOG").Select
ActiveWindow.SelectedSheets.Visible = False
Application.Run "dvtosort"
Application.Run "dvto"
End Sub