ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA edit (https://www.excelbanter.com/excel-discussion-misc-queries/185118-vba-edit.html)

Benjamin

VBA edit
 
I received this code from Don Guillett:

Sub copyalltotheirsheets()
For Each c In Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row)
With Sheets(CStr(c))
..Rows(2).Insert
c.Resize(, 2).Copy .Range("a2")
End With
Next c
End Sub

Currently this copies the data in row A and B. How could I include the data
in column C?

Thanks,

Don Guillett

VBA edit
 
You could have looked at RESIZE in the help index
c.Resize(, 3).Copy .Range("a2")


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Benjamin" wrote in message
...
I received this code from Don Guillett:

Sub copyalltotheirsheets()
For Each c In Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row)
With Sheets(CStr(c))
.Rows(2).Insert
c.Resize(, 2).Copy .Range("a2")
End With
Next c
End Sub

Currently this copies the data in row A and B. How could I include the
data
in column C?

Thanks,




All times are GMT +1. The time now is 03:05 AM.

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