ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add to sheet (https://www.excelbanter.com/excel-programming/339679-add-sheet.html)

oberon.black[_25_]

Add to sheet
 

I have a list of client names on a sheet called client names, I hav
another sheet that I use to track time on I only want to create a cod
on the time tracking sheet that will look on the client name sheet in
column A and B from row 12 to row 42 and then place those names i
column B row 10 - 51 of itself (track time sheet).

I know that on the client name sheet the client name is broken betwee
column A and B, however I would like for it to just place a comm
between the two in column B of the time track worksheet.

Than

--
oberon.blac
-----------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...fo&userid=2673
View this thread: http://www.excelforum.com/showthread.php?threadid=46645


David Lloyd[_3_]

Add to sheet
 
The following code is one approach to this type of copy/merge/paste
operation. I would recommend using range names rather than specific cell
references. The code inserts a new column in the TimeSheet worksheet to
accommodate the two columns of data from the ClientNames worksheet. It then
merges the two columns, inserting a comma between the values. Finally, the
newly inserted column is deleted.

Sub CopyClientNames()
Dim i As Integer

Worksheets("TimeSheet").Activate
Range("C:C").Columns.Insert xlShiftToRight

Worksheets("ClientNames").Activate
Range("A12:B42").Copy

Worksheets("TimeSheet").Activate
Range("B10:B51").PasteSpecial xlPasteAll

Range("B10").Select
For i = 0 To Range("B10", "B51").Rows.Count - 1
If ActiveCell.Value < "" Then
ActiveCell.Value = ActiveCell.Value & "," & ActiveCell.Offset(0,
1).Value
End If
ActiveCell.Offset(1, 0).Select
Next i

Range("C:C").Columns.Delete xlShiftToLeft

Cells(1, 1).Select

End Sub

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


"oberon.black"
wrote in message
news:oberon.black.1v4eub_1126317918.3921@excelforu m-nospam.com...

I have a list of client names on a sheet called client names, I have
another sheet that I use to track time on I only want to create a code
on the time tracking sheet that will look on the client name sheet in
column A and B from row 12 to row 42 and then place those names in
column B row 10 - 51 of itself (track time sheet).

I know that on the client name sheet the client name is broken between
column A and B, however I would like for it to just place a comma
between the two in column B of the time track worksheet.

Thanx


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile:
http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=466456



oberon.black[_35_]

Add to sheet
 

i added this code to the time tracking sheet and it was a dud.

please advic

--
oberon.blac
-----------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...fo&userid=2673
View this thread: http://www.excelforum.com/showthread.php?threadid=46645



All times are GMT +1. The time now is 12:20 AM.

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