Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default help on combine program


Can I please get help with the following code.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Range("a2:a" & lastrow)
c.Offset(, 5) = c & ", " & c.Offset(, 1) & ", " & c.Offset(, 2) & ", " & c.
Offset(, 3)
Next c
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub


this basically will read entire document and combine the cells I want. but I
want to use the sme type of program to combine just one line not read the
entire document as I want to embed it in the same sheet as another chart.

thanks.

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default help on combine program


i don't get the question. Do you want this for a single cell?

this would work for a selected cell or range

with selection
.Offset(, 5) = c & ", " & .Offset(, 1) & ", " & .Offset(, 2) & ", " &
..Offset(, 3)
End With

or for a specific cell it would be

with Range("A1")
.Offset(, 5) = c & ", " & .Offset(, 1) & ", " & .Offset(, 2) & ", " &
..Offset(, 3)
End With


"Darrell_Sarrasin via OfficeKB.com" <u33691@uwe wrote in message
news:97fb2711ea511@uwe...
Can I please get help with the following code.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Range("a2:a" & lastrow)
c.Offset(, 5) = c & ", " & c.Offset(, 1) & ", " & c.Offset(, 2) & ", " &
c.
Offset(, 3)
Next c
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub


this basically will read entire document and combine the cells I want.
but I
want to use the sme type of program to combine just one line not read the
entire document as I want to embed it in the same sheet as another chart.

thanks.

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default help on combine program


currently I have it so that it reads the entire document in columns A-D and E
combines the lines in one cell so I can copy and paste it.

I want to be able to take it and instead of doing the entire document just
run it on one line only.

Patrick Molloy wrote:
i don't get the question. Do you want this for a single cell?

this would work for a selected cell or range

with selection
.Offset(, 5) = c & ", " & .Offset(, 1) & ", " & .Offset(, 2) & ", " &
.Offset(, 3)
End With

or for a specific cell it would be

with Range("A1")
.Offset(, 5) = c & ", " & .Offset(, 1) & ", " & .Offset(, 2) & ", " &
.Offset(, 3)
End With

Can I please get help with the following code.

[quoted text clipped - 19 lines]

thanks.


--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default help on combine program


sorry too early in the morning.

Right now I have it so that someone can put their address in cell A-D. We
need to have it this way as we are are bringing the addresses in from a
database.

So Address is A2, city is B2, State is B3, Zip Code is B4. In b5 we
combine the addresses as we need to put that in another chart.

right now its programmed to read the entire worksheet and combine all the
lines till the last line. I just need it to run the one line not do the
entire document. so I just need it to run row 2 not all.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200906/1

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default help on combine program


you mean one row? that was covered in my code earlier

why not just have a formula
=A1 & B1 & C1 & D1 & E1



"Darrell_Sarrasin via OfficeKB.com" <u33691@uwe wrote in message
news:97fb6c7c208d6@uwe...
currently I have it so that it reads the entire document in columns A-D
and E
combines the lines in one cell so I can copy and paste it.

I want to be able to take it and instead of doing the entire document just
run it on one line only.

Patrick Molloy wrote:
i don't get the question. Do you want this for a single cell?

this would work for a selected cell or range

with selection
.Offset(, 5) = c & ", " & .Offset(, 1) & ", " & .Offset(, 2) & ", " &
.Offset(, 3)
End With

or for a specific cell it would be

with Range("A1")
.Offset(, 5) = c & ", " & .Offset(, 1) & ", " & .Offset(, 2) & ", " &
.Offset(, 3)
End With

Can I please get help with the following code.

[quoted text clipped - 19 lines]

thanks.


--
Message posted via http://www.officekb.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default help on combine program


will that not leave it as a fomula. I need to be able to copy and paste it
as we will be running about 25 instances the same day all with differnt info

Patrick Molloy wrote:
you mean one row? that was covered in my code earlier

why not just have a formula
=A1 & B1 & C1 & D1 & E1

currently I have it so that it reads the entire document in columns A-D
and E

[quoted text clipped - 24 lines]

thanks.


--
Message posted via http://www.officekb.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default help on combine program


just copy/pastespecial Values

"Darrell_Sarrasin via OfficeKB.com" <u33691@uwe wrote in message
news:97fbca0a802de@uwe...
will that not leave it as a fomula. I need to be able to copy and paste
it
as we will be running about 25 instances the same day all with differnt
info

Patrick Molloy wrote:
you mean one row? that was covered in my code earlier

why not just have a formula
=A1 & B1 & C1 & D1 & E1

currently I have it so that it reads the entire document in columns A-D
and E

[quoted text clipped - 24 lines]

thanks.


--
Message posted via http://www.officekb.com

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
How do I combine worksheets w/o enough rows to combine? Amanda W. Excel Worksheet Functions 3 June 9th 09 07:26 AM
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
Is there a good program for excel to combine, compare, and edit bo Myles Excel Discussion (Misc queries) 1 July 19th 07 06:46 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 02:29 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"