Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How can I summarize what is in more cells in a single one

Hello,

So I have a table with some Lines and some Columns. I am filling this
Lines and Columns with the help of a form that is opening when I am
pressing a Button. Every time I press the Button "ADD" on the Form new
lines with the info from the form are inserted in the table. The
Header Columns of the Table is: Pizza, Type, extra topping, size,
Sauce. Price. What I want to do is a summarize on sheet 2. So that I
will have a copy of this table from sheet1 with more columns in just 2
columns on sheet 2. So "Pizza, Type, extra topping, size, Sauce"
should be copied into the first Column on sheet 2 and the Price should
be copied in the second column in the right of column 1 on sheet2. The
code should automatically check all the lines of the table and copy
all to sheet2 not only the first line of the table.

Example:

Column1 Column2 Column3 Column4 Column5 Column6
Pizza, ----- Type,-- extra topping, size, Sauce ---- price

quatro ----- stagioni --- cheese ---- big ---- no sauce ---- 20$


Should get on sheet 2:

--------------Column1 ----------------------------------- Column 2

"quatro big + stagioni + big + no sauce" ------ 20$



The current code is made like this for the form:

Private Sub cmdADD_Click()
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A3").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = cboPizza.Value
ActiveCell.Offset(0, 1) = txtType.Value
ActiveCell.Offset(0, 2) = cboExtratopping.Value

etc etc....

I would like to have something like this with a referential cell like
A3 on Sheet2. like I have the A3 cell for the first sheet.

Thank you very much
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default How can I summarize what is in more cells in a single one

Private Sub cmdADD_Click()
BoxNames = Array("cboPizza", "txtType", "cboExtratopping")

With ActiveWorkbook.Sheets("Sheet1")
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
NewRow = Lastrow + 1
Colcount = 1
For i = LBound(BoxNames) To UBound(BoxNames)

Do While .Cells(NewRow, Colcount) < ""
Colcount = Colcount + 1
Loop
.Cells(NewRow, Colcount) = Controls(BoxNames(i)).Value
Next i
End With
End Sub

" wrote:

Hello,

So I have a table with some Lines and some Columns. I am filling this
Lines and Columns with the help of a form that is opening when I am
pressing a Button. Every time I press the Button "ADD" on the Form new
lines with the info from the form are inserted in the table. The
Header Columns of the Table is: Pizza, Type, extra topping, size,
Sauce. Price. What I want to do is a summarize on sheet 2. So that I
will have a copy of this table from sheet1 with more columns in just 2
columns on sheet 2. So "Pizza, Type, extra topping, size, Sauce"
should be copied into the first Column on sheet 2 and the Price should
be copied in the second column in the right of column 1 on sheet2. The
code should automatically check all the lines of the table and copy
all to sheet2 not only the first line of the table.

Example:

Column1 Column2 Column3 Column4 Column5 Column6
Pizza, ----- Type,-- extra topping, size, Sauce ---- price

quatro ----- stagioni --- cheese ---- big ---- no sauce ---- 20$


Should get on sheet 2:

--------------Column1 ----------------------------------- Column 2

"quatro big + stagioni + big + no sauce" ------ 20$



The current code is made like this for the form:

Private Sub cmdADD_Click()
ActiveWorkbook.Sheets("Sheet1").Activate
Range("A3").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = cboPizza.Value
ActiveCell.Offset(0, 1) = txtType.Value
ActiveCell.Offset(0, 2) = cboExtratopping.Value

etc etc....

I would like to have something like this with a referential cell like
A3 on Sheet2. like I have the A3 cell for the first sheet.

Thank you very much

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How can I summarize what is in more cells in a single one

On Dec 13, 4:30*pm, Joel wrote:
Private Sub cmdADD_Click()
* * BoxNames = Array("cboPizza", "txtType", "cboExtratopping")

* * With ActiveWorkbook.Sheets("Sheet1")
* * * *Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
* * * *NewRow = Lastrow + 1
* * * *Colcount = 1
* * * *For i = LBound(BoxNames) To UBound(BoxNames)

* * * * * Do While .Cells(NewRow, Colcount) < ""
* * * * * * *Colcount = Colcount + 1
* * * * * Loop
* * * * * * * * .Cells(NewRow, Colcount) = Controls(BoxNames(i)).Value
* * * *Next i
* * *End With
End Sub

" wrote:
Hello,


So I have a table with some Lines and some Columns. I am filling this
Lines and Columns with the help of a form that is opening when I am
pressing a Button. Every time I press the Button "ADD" on the Form new
lines with the info from the form are inserted in the table. The
Header Columns of the Table is: Pizza, Type, extra topping, size,
Sauce. Price. What I want to do is a summarize on sheet 2. So that I
will have a copy of this table from sheet1 with more columns in just 2
columns on sheet 2. So "Pizza, Type, extra topping, size, Sauce"
should be copied into the first Column on sheet 2 and the Price should
be copied in the second column in the right of column 1 on sheet2. The
code should automatically check all the lines of the table and copy
all to sheet2 not only the first line of the table.


Example:


Column1 Column2 Column3 Column4 Column5 Column6
Pizza, ----- Type,-- extra topping, size, Sauce ---- price


quatro ----- stagioni *--- *cheese ---- big ---- no sauce ---- 20$


Should get on sheet 2:


--------------Column1 ----------------------------------- Column 2


"quatro big *+ stagioni *+ big + no sauce" ------ * 20$


The current code is made like this for the form:


Private Sub cmdADD_Click()
* * ActiveWorkbook.Sheets("Sheet1").Activate
* * Range("A3").Select
* * Do
* * If IsEmpty(ActiveCell) = False Then
* * * * ActiveCell.Offset(1, 0).Select
* * End If
* * Loop Until IsEmpty(ActiveCell) = True
* * ActiveCell.Value = cboPizza.Value
* * ActiveCell.Offset(0, 1) = txtType.Value
* * ActiveCell.Offset(0, 2) = cboExtratopping.Value


etc etc....


I would like to have something like this with a referential cell like
A3 on Sheet2. like I have the A3 cell for the first sheet.


Thank you very much


That is not exactly what I wanted.

I want to have what is in A3, B3, C3, D3, E3, F3, G3, H3, I3 from
Sheet 1 into Sheet 2 all in A3 and what is in J3 from Sheet1 in B3 on
Sheet2. And it should apply for every row that follows under A3... so
for A4 to J4, for A5 to J5 and so on... but only if these cells are
filled in with information...
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How can I summarize what is in more cells in a single one

So I found some way to do it as a formula

I am inserting the formula on sheet2 in some Cell I want:

=TRIM(CONCATENATE(Sheet1!A4," ",Sheet1B4," ",Sheet1C4," ",Sheet1D4,"
",Sheet1E4))


PROBLEM:

On sheet1 I have a delete Button for entire rows so that I can delete
a Pizza if I entered something wrong into the list. And when I am
deleting the row, on sheet 2 It appears: #REF! #REF! #REF! #REF! -
because I deleted the row. What I want, is that this does not happen
on sheet2. It should notice that I deleted a row and just take the
next row.

Is there a way to do that in a macro? or do I need another formula?
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default How can I summarize what is in more cells in a single one

Private Sub cmdADD_Click()
BoxNames = Array("cboPizza", "txtType", "cboExtratopping")

With ActiveWorkbook.Sheets("Sheet1")
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
NewRow = Lastrow + 1
Colcount = 1
Do While .Cells(NewRow, Colcount) < ""
Colcount = Colcount + 1
Loop
PizzaOrder = ""
For i = LBound(BoxNames) To UBound(BoxNames)

if PizzaOrder = "" then
PizzaOrder = Controls(BoxNames(i)).Value
else
PizzaOrder = PizzaOrder & " " & Controls(BoxNames(i)).Value
Next i
.cells(NewRow, ColCount) = PizzaOrder
End With
End Sub


" wrote:

So I found some way to do it as a formula

I am inserting the formula on sheet2 in some Cell I want:

=TRIM(CONCATENATE(Sheet1!A4," ",Sheet1B4," ",Sheet1C4," ",Sheet1D4,"
",Sheet1E4))


PROBLEM:

On sheet1 I have a delete Button for entire rows so that I can delete
a Pizza if I entered something wrong into the list. And when I am
deleting the row, on sheet 2 It appears: #REF! #REF! #REF! #REF! -
because I deleted the row. What I want, is that this does not happen
on sheet2. It should notice that I deleted a row and just take the
next row.

Is there a way to do that in a macro? or do I need another formula?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How can I summarize what is in more cells in a single one

On Dec 14, 2:23*pm, Joel wrote:
*Private Sub cmdADD_Click()
* * *BoxNames = Array("cboPizza", "txtType", "cboExtratopping")

* * *With ActiveWorkbook.Sheets("Sheet1")
* * * * Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
* * * * NewRow = Lastrow + 1
* * * * Colcount = 1
* * * * Do While .Cells(NewRow, Colcount) < ""
* * * * * *Colcount = Colcount + 1
* * * * Loop
* * * * PizzaOrder = "" * * * *
* * * * For i = LBound(BoxNames) To UBound(BoxNames)

* * * * * *if PizzaOrder = "" then
* * * * * * * PizzaOrder = Controls(BoxNames(i)).Value
* * * * * *else
* * * * * * * PizzaOrder = PizzaOrder & " " & Controls(BoxNames(i)).Value
* * * * Next i
* * * * .cells(NewRow, ColCount) = PizzaOrder
* * * End With
*End Sub

" wrote:
So I found some way to do it as a formula


I am inserting the formula on sheet2 in some Cell I want:


=TRIM(CONCATENATE(Sheet1!A4," ",Sheet1B4," ",Sheet1C4," ",Sheet1D4,"
",Sheet1E4))


PROBLEM:


On sheet1 I have a delete Button for entire rows so that I can delete
a Pizza if I entered something wrong into the list. And when I am
deleting the row, on sheet 2 It appears: #REF! * * #REF! * #REF! * #REF! *-
because I deleted the row. What I want, is that this does not happen
on sheet2. It should notice that I deleted a row and just take the
next row.


Is there a way to do that in a macro? or do I need another formula?


This code seems not to work.

Message: "Next without For"
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default How can I summarize what is in more cells in a single one

Th eonly way you would get the error message is if you didn't copy the code
exactly as posted or you modified the code. Post your lasted code and I will
look at it.

" wrote:

On Dec 14, 2:23 pm, Joel wrote:
Private Sub cmdADD_Click()
BoxNames = Array("cboPizza", "txtType", "cboExtratopping")

With ActiveWorkbook.Sheets("Sheet1")
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
NewRow = Lastrow + 1
Colcount = 1
Do While .Cells(NewRow, Colcount) < ""
Colcount = Colcount + 1
Loop
PizzaOrder = ""
For i = LBound(BoxNames) To UBound(BoxNames)

if PizzaOrder = "" then
PizzaOrder = Controls(BoxNames(i)).Value
else
PizzaOrder = PizzaOrder & " " & Controls(BoxNames(i)).Value
Next i
.cells(NewRow, ColCount) = PizzaOrder
End With
End Sub

" wrote:
So I found some way to do it as a formula


I am inserting the formula on sheet2 in some Cell I want:


=TRIM(CONCATENATE(Sheet1!A4," ",Sheet1B4," ",Sheet1C4," ",Sheet1D4,"
",Sheet1E4))


PROBLEM:


On sheet1 I have a delete Button for entire rows so that I can delete
a Pizza if I entered something wrong into the list. And when I am
deleting the row, on sheet 2 It appears: #REF! #REF! #REF! #REF! -
because I deleted the row. What I want, is that this does not happen
on sheet2. It should notice that I deleted a row and just take the
next row.


Is there a way to do that in a macro? or do I need another formula?


This code seems not to work.

Message: "Next without For"

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
Autofill of single cells Dannie Excel Discussion (Misc queries) 2 October 20th 08 07:24 AM
split single cells Idaho Excel Worksheet Functions 2 September 5th 08 10:53 PM
Summarize cells in another workbook streetspeedin Excel Discussion (Misc queries) 0 April 14th 06 09:34 PM
Copy column range of "single word" cells with spaces to a single c nastech Excel Discussion (Misc queries) 3 February 15th 06 05:04 PM
Pasting single cells from Word to multiple cells in Excel ASBiss Excel Worksheet Functions 1 February 15th 05 11:47 AM


All times are GMT +1. The time now is 12:34 PM.

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

About Us

"It's about Microsoft Excel"