I need some help - google hasn't led me to anything useful
In my workbook, Sheet1 is a template used to analyze some data. Sheet2 is a list of values. My current macro asks a user how many times they need the template copied, and then copies Sheet1 as a new tab at the end of the workbook the requested number of times. I need to update this and do some more automation, but I just don't know how.
First, I want to automatically count the number of values in my list and use that count to tell my macro how many new tabs to create. Then, each new tab needs to have a value from the list copied and pasted into cell C3.
For example:
Sheet2's list in Column A might have 3 values:
Apple
Boat
Potato
I want the macro to count that there are three values, and then copy the first value paste into C3 in the first new tab, second value from the list and paste into C3 in the second new tab, third value from the list and paste into C3 in the third new tab.
So,
NewTab1.C3 = Apple
NewTab2.C3 = Boat
NewTab3.C3 = Potato
My current code isn't really powerful. Can anyone help me with some of this automation???? Pretty please?!?!?!?
In my workbook, Sheet1 is a template used to analyze some data. Sheet2 is a list of values. My current macro asks a user how many times they need the template copied, and then copies Sheet1 as a new tab at the end of the workbook the requested number of times. I need to update this and do some more automation, but I just don't know how.
First, I want to automatically count the number of values in my list and use that count to tell my macro how many new tabs to create. Then, each new tab needs to have a value from the list copied and pasted into cell C3.
For example:
Sheet2's list in Column A might have 3 values:
Apple
Boat
Potato
I want the macro to count that there are three values, and then copy the first value paste into C3 in the first new tab, second value from the list and paste into C3 in the second new tab, third value from the list and paste into C3 in the third new tab.
So,
NewTab1.C3 = Apple
NewTab2.C3 = Boat
NewTab3.C3 = Potato
My current code isn't really powerful. Can anyone help me with some of this automation???? Pretty please?!?!?!?
VBA Code:
Sub CopyConfigRequest()
Application.ScreenUpdating = False
Worksheets("Sheet1").Activate
Dim n As Integer
On Error Resume Next
n = InputBox("How many copies of the configuration request sheet do you want to make?")
If n >= 1 Then
For numtimes = 1 To n
ActiveSheet.Copy After:=ActiveWorkbook.Sheets(Worksheets.Count)
Next
End If
Worksheets("Sheet2").Activate
Application.ScreenUpdating = True
Call wkstcolor
End Sub