ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Paste from other sheets to below current text (https://www.excelbanter.com/excel-discussion-misc-queries/205497-paste-other-sheets-below-current-text.html)

Jeff S.[_2_]

Paste from other sheets to below current text
 
I'm trying to copy text from other sheets (Dir) and post below current text
(Temp) if there is any. I keep getting errors. What am I doing wrong?

If DirectorBox = True Then
Application.CutCopyMode = False
Worksheets("Dir").Activate
ActiveSheet.UsedRange.Copy
Worksheets("Temp").Activate
If Range("A1") < "" Then
Range("A1").End(xlDown).Offset(1, 0).Select
Else
ActiveSheet.Cells(1, 1).Select
End If
ActiveSheet.Paste
End If

Mike H

Paste from other sheets to below current text
 
Jeff,

Maybe a bit simpler

If DirectorBox = True Then
Worksheets("Dir").UsedRange.Copy
lastrow = Sheets("Temp").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Worksheets("Temp").Range("A" & lastrow + 1).PasteSpecial
End If

Mike

"Jeff S." wrote:

I'm trying to copy text from other sheets (Dir) and post below current text
(Temp) if there is any. I keep getting errors. What am I doing wrong?

If DirectorBox = True Then
Application.CutCopyMode = False
Worksheets("Dir").Activate
ActiveSheet.UsedRange.Copy
Worksheets("Temp").Activate
If Range("A1") < "" Then
Range("A1").End(xlDown).Offset(1, 0).Select
Else
ActiveSheet.Cells(1, 1).Select
End If
ActiveSheet.Paste
End If


Don Guillett

Paste from other sheets to below current text
 
or
If DirectorBox = True Then
with sheets("temp")
lastrow = .cells(Rows.Count, "A").End(xlUp).Row+1
Worksheets("Dir").UsedRange.Copy .cells(lastrow,"a")
end with
end if

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mike H" wrote in message
...
Jeff,

Maybe a bit simpler

If DirectorBox = True Then
Worksheets("Dir").UsedRange.Copy
lastrow = Sheets("Temp").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Worksheets("Temp").Range("A" & lastrow + 1).PasteSpecial
End If

Mike

"Jeff S." wrote:

I'm trying to copy text from other sheets (Dir) and post below current
text
(Temp) if there is any. I keep getting errors. What am I doing wrong?

If DirectorBox = True Then
Application.CutCopyMode = False
Worksheets("Dir").Activate
ActiveSheet.UsedRange.Copy
Worksheets("Temp").Activate
If Range("A1") < "" Then
Range("A1").End(xlDown).Offset(1, 0).Select
Else
ActiveSheet.Cells(1, 1).Select
End If
ActiveSheet.Paste
End If




All times are GMT +1. The time now is 01:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com