Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default passing data from one sheet to another

Hello

I have data in a1 and a2 of sheet 1
how would you pass that data to a single cell in sheet 2 a1

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default passing data from one sheet to another


How would you place this in vb editor with a space

Have tried putting & " " & in between but did not work
here is my code:

Private Sub CommandButton1_Click()

Sheets("Sheet2").Select
ActiveCell = "=Sheet1!A1 & Sheet1!A2"

End Sub

I will be using a for loop to bring data from one sheet to the other
as the user inputs. How would I include iteration variable "i" in
Sheet1!A1


Thanks for your answers


On Fri, 11 Jul 2003 19:36:16 -0600, "J.E. McGimpsey"
wrote:

You could concatenate them by putting this in Sheet2!A1:

=Sheet1!A1 & Sheet1!A2

In article ,
billabong < wrote:

Hello

I have data in a1 and a2 of sheet 1
how would you pass that data to a single cell in sheet 2 a1

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default passing data from one sheet to another

One way:

Sheets("Sheet2").Range("A1").Value = _
Sheets("Sheet1").Range("A1") & " " & _
Sheets("Sheet1").Range("A2")

which can be shortened a bit:

With Sheets("Sheet1")
Sheets("Sheet2").Range("A1").Value = _
.Range("A1").Value & " " & .Range("A2").Value
End With

or even

With Sheets("Sheet1").Range("A1")
Sheets("Sheet2").Range("A1").Value = _
.Value & " " & .Offset(1, 0).Value
End With

Note that you almost never need to select or activate a range in
order to work with it. Using the range object directly makes your
code smaller, faster and, IMO, easier to maintain.

In article ,
billabong < wrote:

How would you place this in vb editor with a space

Have tried putting & " " & in between but did not work
here is my code:

Private Sub CommandButton1_Click()

Sheets("Sheet2").Select
ActiveCell = "=Sheet1!A1 & Sheet1!A2"

End Sub

I will be using a for loop to bring data from one sheet to the other
as the user inputs. How would I include iteration variable "i" in
Sheet1!A1


Thanks for your answers


On Fri, 11 Jul 2003 19:36:16 -0600, "J.E. McGimpsey"
wrote:

You could concatenate them by putting this in Sheet2!A1:

=Sheet1!A1 & Sheet1!A2

In article ,
billabong < wrote:

Hello

I have data in a1 and a2 of sheet 1
how would you pass that data to a single cell in sheet 2 a1

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default passing data from one sheet to another

Private Sub CommandButton1_Click()

Sheets("Sheet2").Select
ActiveCell.Resize(1,10) = "=Sheet1!A1 & "" "" & Sheet1!A2"

End Sub

You would need a more complex formula if you want to go down the column on
sheet2 and each cell would reference two cells down in sheet1.

Regards,
Tom Ogilvy



<billabong wrote in message
...

How would you place this in vb editor with a space

Have tried putting & " " & in between but did not work
here is my code:

Private Sub CommandButton1_Click()

Sheets("Sheet2").Select
ActiveCell = "=Sheet1!A1 & Sheet1!A2"

End Sub

I will be using a for loop to bring data from one sheet to the other
as the user inputs. How would I include iteration variable "i" in
Sheet1!A1


Thanks for your answers


On Fri, 11 Jul 2003 19:36:16 -0600, "J.E. McGimpsey"
wrote:

You could concatenate them by putting this in Sheet2!A1:

=Sheet1!A1 & Sheet1!A2

In article ,
billabong < wrote:

Hello

I have data in a1 and a2 of sheet 1
how would you pass that data to a single cell in sheet 2 a1

Thanks




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
Passing data to fix cell Amnon Wilensky Excel Worksheet Functions 4 March 10th 09 04:58 PM
formula for % passing RKing Excel Worksheet Functions 2 August 30th 07 03:32 PM
Passing a row to a function dch3 Excel Worksheet Functions 2 July 31st 06 12:34 PM
Passing values in Sheet to VBA Jonathan Charts and Charting in Excel 1 June 30th 06 06:00 AM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 07:46 PM


All times are GMT +1. The time now is 11:01 AM.

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"