Enter Range value and get report
How about this for a basis:
Private Sub CommandButton1_Click()
Dim Cell_txt_1 As String
Dim Cell_txt_2 As String
Cell_txt_1 = "A1" ' for testing ... needs to come from TextBox
Cell_txt_2 = "A25" ' for testing ... needs to come from TextBox
With Sheets("Sheet1")
.Range(Cell_txt_1 & ":" & Cell_txt_2).Copy
With Sheets("Sheet2")
.Range("A1").PasteSpecial Paste:=xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=True
End With
End With
Application.CutCopyMode = False
End Sub
Regards
Trevor
"OK" wrote in message
ups.com...
Hi All,
I hv a excel file with above 203 rows, and 54 columns, It is required
to view these perodically and generate report. I hv tried to make a
userform with two text boxes where user can enter the range row wise
only (e.g A1 and A53), after entering and clicking the command button
the data of this particular row range will be copied and pasted as
transposed in sheet 2 after which the user can print this sheet. Im
not too worried about the formats or print view stuff, just like to
make this work, I'll appreciate if anyone can help...
I tried the following code but getting errors,
Private Sub CommandButton1_Click()
'
'
Sheets("Sheet1").Select
Range("ActiveCell.Value = Cell_txt_1.Value:ActiveCell.Value =
Cell_txt_2.Value").Select
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
End Sub
Regards
OK
|