PDA

View Full Version : Help in saving datas without leaving spaces in between



joly86
10-28-2008, 05:51 AM
I have 2 sheets, first is the sales receipt and the second is the master order.

When i am done with my sales receipt, i will need to save the data into my master order.

eg. pizza 1 regular $8


coke 1 can $1.20

calamari 1 set $3


There are spaces in between the sales receipt, how can i save the data without leaving space in my master order?

Also when i start a new order, my new data will add on to the saved datas in my master order with jus a space in between new order and previous order. Can it be done?


I am really noob in vba so pls help me. Thanks alot

Bob Phillips
10-28-2008, 05:55 AM
Do you mean that you want to strip out all the embedded spaces?



myVar = Replace(Wokrsheets("Sales receipt").Range("A5").Value, " ",""))

joly86
10-28-2008, 06:05 AM
yes....

because my sales receipt is splitted into different categories

eg. Pizza

Side Orders

Combos


there will have spaces in between for my input of the orders and there will bound to have empty spaces after one order. So I will like to remove the spaces in the master order when I save my sales receipt..

Bob Phillips
10-28-2008, 06:06 AM
So can you use what I showed previously?

joly86
10-28-2008, 06:17 AM
Where do I insert this code?


Attached above is the draft of the model, hope this looks clearer..

Bob Phillips
10-28-2008, 06:37 AM
Impossible for me to say, I just showed you a technique. You have no code in that workbook for me to look at, I don't know what you want to do, how you want to do it.

joly86
10-28-2008, 06:44 AM
sorry abt it.

this copy has the vba in it but it is very long because I try to copy, paste cell by cell and do relative references.