M
Montse
I have recorded a macro that makes a workbook visible, it selects some
information, copies it, pastes it as values, copies it again to have it ready
for pasting it in another worksheet, and then it hides the workbook. All
works perfectly with the only exception that it is not very neat because the
workbook appears and disappears for a fraction of second, like the flash of a
camera.
My two questions are:
1. Is there any alternative code to do it in a more neat way?
2. I would like that "Range(B14:V21").Select" selects only the rows with
information (e.g. if only the first three rows have information, then it
selects B14:V16 only).
I wonder who could help me with this?
The current code is:
Sub CopyPaste()
Sheets("CopyPaste").Visible = True
Sheets("CopyPaste").Select
Range("B5:V12").Select
Selection.Copy
Range("B14:V21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Sheets("PV").Select
Range("B2").Select
Sheets("CopyPaste").Visible = False
End Sub
Thank you,
information, copies it, pastes it as values, copies it again to have it ready
for pasting it in another worksheet, and then it hides the workbook. All
works perfectly with the only exception that it is not very neat because the
workbook appears and disappears for a fraction of second, like the flash of a
camera.
My two questions are:
1. Is there any alternative code to do it in a more neat way?
2. I would like that "Range(B14:V21").Select" selects only the rows with
information (e.g. if only the first three rows have information, then it
selects B14:V16 only).
I wonder who could help me with this?
The current code is:
Sub CopyPaste()
Sheets("CopyPaste").Visible = True
Sheets("CopyPaste").Select
Range("B5:V12").Select
Selection.Copy
Range("B14:V21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Sheets("PV").Select
Range("B2").Select
Sheets("CopyPaste").Visible = False
End Sub
Thank you,