B
Brian
Hi All,
I have a series of Case Statements which will write to a report sheet. I
then want to copy the sheet to a new workbook. I have placed the command
Sheets("Report").Copy in various places, but it does nothing. Any suggestions
as to what I am doing wrong?
Private Sub ComboBox1_click()
Dim i As Long, rng As Range
Dim refrange As Range
Dim c As Range
ComboBox2.ListIndex = -1
ComboBox3.ListIndex = -1
ComboBox4.ListIndex = -1
ComboBox5.ListIndex = -1
Select Case ComboBox1.Value
Case "GSOP_0286"
Sheets("Report").Range("A4:I20").Clear
Set refrange = Sheets("Sheet2").Range("A3:A20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else
s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c
[More Case Statements]
End Select
Sheets (“Reportâ€).Select
Sheets (“Reportâ€).Copy
Thanks,
I have a series of Case Statements which will write to a report sheet. I
then want to copy the sheet to a new workbook. I have placed the command
Sheets("Report").Copy in various places, but it does nothing. Any suggestions
as to what I am doing wrong?
Private Sub ComboBox1_click()
Dim i As Long, rng As Range
Dim refrange As Range
Dim c As Range
ComboBox2.ListIndex = -1
ComboBox3.ListIndex = -1
ComboBox4.ListIndex = -1
ComboBox5.ListIndex = -1
Select Case ComboBox1.Value
Case "GSOP_0286"
Sheets("Report").Range("A4:I20").Clear
Set refrange = Sheets("Sheet2").Range("A3:A20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else
s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c
[More Case Statements]
End Select
Sheets (“Reportâ€).Select
Sheets (“Reportâ€).Copy
Thanks,