wethegoodvibes
New Member
- Joined
- Aug 29, 2019
- Messages
- 3
Hello
I am working on an excel file with 7 sheets. The main interaction that a user will have with the worksheet is through a user form. The user form as multiple pages and one page is already completely functional. The next page, however, is giving me a lot of problems. The first problem I am working through not being able to paste a collection cells that is on a reference sheet (sheet 7). The collection of cells is a template of sorts with colored cells and a border in certain spots. It is 2 columns x 12 rows. I need to paste that template every time the user hits the “New Day” button on the user form.
So far I understand that the following code may work to go to a new line every time the “New Day” button is pressed. I have defined the template selection as “StartUpTemplate” on sheet 7. My thought is that it will paste that template in the D and E columns every time the “New Day” button is pressed. But it doesn’t know what “StartUpTemplate” is. So how do I store that template into a variable to paste on command?
Private Sub NewDayCommandButton_Click()
Dim NewDay As Range
Dim StartUpData As Worksheet
Set StartUpData = Sheet5
Set NewDay = StartUpData.Range("D65356").End(xlUp).Offset(13, 0)
NewDay.Offset(0, 0).Value = StartUpTemplate
End Sub
I am working on an excel file with 7 sheets. The main interaction that a user will have with the worksheet is through a user form. The user form as multiple pages and one page is already completely functional. The next page, however, is giving me a lot of problems. The first problem I am working through not being able to paste a collection cells that is on a reference sheet (sheet 7). The collection of cells is a template of sorts with colored cells and a border in certain spots. It is 2 columns x 12 rows. I need to paste that template every time the user hits the “New Day” button on the user form.
So far I understand that the following code may work to go to a new line every time the “New Day” button is pressed. I have defined the template selection as “StartUpTemplate” on sheet 7. My thought is that it will paste that template in the D and E columns every time the “New Day” button is pressed. But it doesn’t know what “StartUpTemplate” is. So how do I store that template into a variable to paste on command?
Private Sub NewDayCommandButton_Click()
Dim NewDay As Range
Dim StartUpData As Worksheet
Set StartUpData = Sheet5
Set NewDay = StartUpData.Range("D65356").End(xlUp).Offset(13, 0)
NewDay.Offset(0, 0).Value = StartUpTemplate
End Sub