ASP Free Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherASP Free Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 11th, 2004, 02:28 AM
wolferd1 wolferd1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 wolferd1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
excel text

Using Office 2000. I would like to take data in a1, combine it with data in b1, and place it back in a1. ie a1 contains "Tom" b1 contains "jones" I would like to combine them so that a1 becomes "Tom Jones"

I tried copying them to other columns then concatenating them to a1, but when I deleted the "extra" columns which I had originally moved them to, I also deleted the concatenate formula and all the text disappeared from a1.

Any help greatly appreciated.

wolferd

Reply With Quote
  #2  
Old December 11th, 2004, 12:33 PM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 5
Hello wolferd1,

Paste the code below into your excel macro. Remember to change the workbook and worksheet to the suitable name for your case

Code:
Sub Macro1()
   Dim MySheet As Worksheet
   Dim RowNumber As Integer
   Const ColumnA = 1
   Const ColumnB = 2
   Set MySheet = Workbooks("Book1.xls").Worksheets("Sheet1")
   With MySheet
	  RowNumber = 1
	  While Not IsEmpty(.Cells(RowNumber, ColumnA))
		 .Cells(RowNumber, ColumnA) = .Cells(RowNumber, ColumnA) & " " & .Cells(RowNumber, ColumnB)
		 RowNumber = RowNumber + 1
	  Wend
   End With
End Sub
 

Reply With Quote
  #3  
Old December 11th, 2004, 01:05 PM
wolferd1 wolferd1 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 wolferd1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
JamesLe

That is great and does exactly what I needed. I have not had occasion to use macros before. I see a new way to learning and doing things. Is there an online site or a suggested book for learning this?

Thanks
wolferd




Quote:
Originally Posted by JamesLe
Hello wolferd1,

Paste the code below into your excel macro. Remember to change the workbook and worksheet to the suitable name for your case

Code:
 Sub Macro1()
    Dim MySheet As Worksheet
    Dim RowNumber As Integer
    Const ColumnA = 1
    Const ColumnB = 2
    Set MySheet = Workbooks("Book1.xls").Worksheets("Sheet1")
    With MySheet
 	  RowNumber = 1
 	  While Not IsEmpty(.Cells(RowNumber, ColumnA))
		 .Cells(RowNumber, ColumnA) = .Cells(RowNumber, ColumnA) & " " & .Cells(RowNumber, ColumnB)
 		 RowNumber = RowNumber + 1
 	  Wend
    End With
 End Sub
  
 

Reply With Quote
  #4  
Old December 13th, 2004, 01:49 AM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 5
Hello wolferd1,

I don't have any particular books to suggest but you may do google search for Excel VBA or Excel Programming books

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherASP Free Lounge > excel text


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT