View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Merge simple macros to create Complex macro

newSheetName = ws.Cells(iRow, 1) & ws.Cells(iRow, 2)

to

newSheetName = ws.Cells(iRow, 1) "," & ws.Cells(iRow, 2)

or to include a space

newSheetName = ws.Cells(iRow, 1) "," & ws.Cells(iRow, 2)


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

This code works great.


Code:
--------------------

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.TextBox56.Value
ws.Cells(iRow, 2).Value = Me.TextBox55.Value
newSheetName = ws.Cells(iRow, 1)

--------------------


I this section I had to change it to

Code:
--------------------

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.TextBox56.Value
ws.Cells(iRow, 2).Value = Me.TextBox55.Value
newSheetName = ws.Cells(iRow, 1) & ws.Cells(iRow, 2)

--------------------


so that it would give me both first and last name in the New WorkSheet
Tab.

However, I need to insert a comma between the names in the first and
last name in the Worksheet tab. How can this be done?

I also need to know how to chang the script to identify the sheet I
want to copy. The script currently copies the active sheet but I want
it to copy another sheet that is in the workbook. How can this be done
or maybe I should say where is this done?

Thanks.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile:

http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=399875