Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
May May is offline
external usenet poster
 
Posts: 15
Default combine information in two cells into the third column

I've been trying to write a macro as below to commit above task, but errors
like "variable not defined" and "sub or function not defined" keep poping up.

Sub Macro1()
x = 3
Do While ActiveCell(x, 11).Value < ""
Cells(x, 10).Value = "PO#" + Cell(x, 1).Value + " " + Cell(x, 3).Value
x = x + 1
Loop

End Sub

Could you please help? I'm a beginner at the stage and so happy to find out
this wonderful community.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default combine information in two cells into the third column

after Sub Macro1()
Type:

Dim x as Integer

That will define your variable for the system.

"May" wrote:

I've been trying to write a macro as below to commit above task, but errors
like "variable not defined" and "sub or function not defined" keep poping up.

Sub Macro1()
x = 3
Do While ActiveCell(x, 11).Value < ""
Cells(x, 10).Value = "PO#" + Cell(x, 1).Value + " " + Cell(x, 3).Value
x = x + 1
Loop

End Sub

Could you please help? I'm a beginner at the stage and so happy to find out
this wonderful community.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default combine information in two cells into the third column

May

Couple of things to change....................note the "&" which is the
concatenation operator. "+" is for arithmetic.

Also "Cells" instead of "Cell"

Sub Macro1()
Dim x As Integer
x = 3
Do While Cells(x, 11).Value < ""
Cells(x, 10).Value = "PO#" & Cells(x, 1).Value & " " & Cells(x, 3).Value
x = x + 1
Loop

End Sub


Gord Dibben MS Excel MVP

On Mon, 5 Feb 2007 15:10:00 -0800, May wrote:

I've been trying to write a macro as below to commit above task, but errors
like "variable not defined" and "sub or function not defined" keep poping up.

Sub Macro1()
x = 3
Do While ActiveCell(x, 11).Value < ""
Cells(x, 10).Value = "PO#" + Cell(x, 1).Value + " " + Cell(x, 3).Value
x = x + 1
Loop

End Sub

Could you please help? I'm a beginner at the stage and so happy to find out
this wonderful community.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking if information in a cell is within a column Andrew M. Excel Worksheet Functions 6 January 29th 07 06:15 PM
Dependant or Refenced Cells Calculations Reha Excel Discussion (Misc queries) 10 December 6th 06 12:02 PM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 03:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"