ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy macro (https://www.excelbanter.com/excel-programming/366952-copy-macro.html)

dan

copy macro
 
Hi,

If Sheet1 contains "Technology" in Column H, I would like it to copy
the entire row to Sheet 2. I have looked at other posts but still
cannot get it.

Any help would be appreciated.

Thanks!


Ardus Petus

copy macro
 
Hi Dan,

Do you want rows from Sheet1 to be copied to same row num in sheet2, or next
available row ?

Cheers,
--
AP

"dan" a écrit dans le message de news:
...
Hi,

If Sheet1 contains "Technology" in Column H, I would like it to copy
the entire row to Sheet 2. I have looked at other posts but still
cannot get it.

Any help would be appreciated.

Thanks!




Ardus Petus

copy macro
 
If same row, try:

Sub tester()
Dim rCell As Range
For Each rCell In Worksheets("Sheet1").UsedRange.Columns("H").Cells
If rCell.Value = "Technology" Then
rCell.EntireRow.Copy Worksheets("Sheet2").Cells(rCell.Row, "A")
End If
Next rCell
End Sub

HTH
--
AP

"Ardus Petus" a écrit dans le message de news:
...
Hi Dan,

Do you want rows from Sheet1 to be copied to same row num in sheet2, or
next available row ?

Cheers,
--
AP

"dan" a écrit dans le message de news:
...
Hi,

If Sheet1 contains "Technology" in Column H, I would like it to copy
the entire row to Sheet 2. I have looked at other posts but still
cannot get it.

Any help would be appreciated.

Thanks!






dan

copy macro
 
Thank you so much for your response. I would like it to just dump rows
with Technology in the next available row. If you could help me modify
this that would be great.

Thanks!!


Ardus Petus

copy macro
 
Sub tester()
Dim rCell As Range
For Each rCell In Worksheets("Sheet1").UsedRange.Columns("H").Cells
If rCell.Value = "Technology" Then
rCell.EntireRow.Copy Worksheets("Sheet2") _
.Cells(Rows.Count, "A").End(xlUp).Item(2)
End If
Next rCell
End Sub

HTH
--
AP

"dan" a écrit dans le message de news:
...
Thank you so much for your response. I would like it to just dump rows
with Technology in the next available row. If you could help me modify
this that would be great.

Thanks!!





All times are GMT +1. The time now is 05:45 PM.

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