View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default please answer me, i need your helps!!!

The key words in your message being "I'm guessing". If the OP follows my
advice in future questions, or in a follow up to this thread, there will be
no need for any of us to use those words.

--
Rick (MVP - Excel)


"JLGWhiz" wrote in message
...
I'm guessing it is a strip mining operation and the OP is trying to
project the amount of soil to be removed over a certain time period, or
track the removal over a time period.


"Rick Rothstein" wrote in message
...
You do have VB... it is built into Excel... and Patrick told you how to
get into it when he said "Open the VBA editor (ALT+F11), then add a new
module (INSERT/MODULE) and paste this code". See the ALT-F11 part? That
means from any worksheet in Excel, hold down the ALT key and then push
the F11 key (then release them both). The INSERT/MODULE part means find
INSERT on the menu bar (once you are in the VB editor) and click it, then
when its sub-menu opens, click the MODULE entry in that. Next, copy/paste
the code that Patrick posted into the code window that opened up when you
clicked the INSERT/MODULE menu entry.

If Patrick's code does what you want, then great; but if it doesn't, then
you will need to supply a clearer description of what you want. When
doing so, you should keep in mind that no one here knows what your
business model is nor what its requirements are, so you have to tell us
in enough detail so that we can understand them. Also, instead of relying
solely on a written description, show us examples of your various
conditions and examples of what you want to produce from them so that we
can see what your verbal description is talking about.

--
Rick (MVP - Excel)


"sanaz" wrote in message
...
hi patrick,
i am really sorry, ive never used this discussion board before!!
and the thing is that, yesterday that I sent that question I thought it
did
not go through because it wasnt on my profile, then i thought maybe it
is
because it was so long, any way thats why I just ask shorter question?1

now that you said I checked your answer, thank you so much for that, but
the
thing is that I dont have visual basic so is there any way that I could
just
either use statements such as if ,... or use the macro which is with
matlab.

and you are right this is a project, and i know very little about excel
thats why i am in panic state because its due friday and i havnt done
much:(

any way patrick, as i said i am sorry but i am really looking forward to
hear from you because you seem that you know what I should do, if you
have
time I could send you my spread sheet so that you know how much I ve
done and
help me so that i could do more

Kind Regards
sanaz

"Patrick Molloy" wrote:

1) please. The subject should indicate the type of problem, This is a
help
group, so "please help" tells us nothing.

2) we like simple questions. your sounds like a project and thats a
deterrent ;)
However. Is seems that you will ennter the data for rows 1 and two,
then you
need
rows 3 to nn added for each value of z from 0 to nn incrementing by 1

this may get you started. Open the VBA editor (ALT+F11), then add a new
module (INSERT/MODULE) and paste this code:

Option Explicit
Sub Main()
Dim rw As Long ' for rows
Dim cl As Long ' for columns
Dim nn_max As Long 'nn - highest Z value
Dim sFormula As String
sFormula = "=R1C * R2C*rand()"
nn_max = InputBox("Enter Value for max z", , 0)

With Range(Range("B3"),
Range("A1").End(xlToRight).Offset(2)).Resize(nn_ma x
+ 1)
.FormulaR1C1 = sFormula
End With
With Range("A3").Resize(nn_max + 1)
.Formula = "=""Z="" & Row()-3"
End With

For rw = 3 To nn_max + 3
Cells(rw, 1) = "z=" & rw - 3
For cl = 2 To Range("A1").End(xlToRight).Column
Cells(rw, cl).Formula = sFormula
Next
Next
End Sub







"sanaz" wrote:

i need to produce a table in excel to do this with out me expanding
it, what
i mean is i only have the first two colums and then it shoul dexpand
it self
programically!!

these are the conditions that my table sshould have:
1. the first row of the table should be the time intervals (I have
already
defined my time interval increment, eg: dt=0.25 year)and the first
colume
should start from time zero and the final time that I need to have
calcuation
is 1.5 year.
so the first row look like this,
time(year) 0 0.25 0.5 0.75 1 1.25 1.5

but the thing here is that i can drag the equation and it will be
fine but I
should just have the first and second colume values and be able to
expand it
self to 1.5 yr and after that stop,(depending on final time)

2.my second row should be my load increaments, but this also
varies( in my
spread sheet I have defined, no change in load with zero, constant
change
with one and abrupt change with 2. but I might have a constant change
from 0
kpa to 40kpa from time interval of 0 to 0.5 yr, then at o.5 yr I have
a
abrupt change of load and the load increase by 20 and then stay at
60kpa
untill 1.5yr.
how I can programm this?

3.then my third row is when z=0 (z refere to my soil depth, so when
is zero
it means on the surface)
and the condition here is that when at time zero I apply a load of
0kpa or
40Kpa (what ever the value is then the value that it should put
underneath
t=0 and infront of z=0 should be equal to that load). if the load
change
constanlty or not changing the values in row 3, infront of the z=0
for other
time intervals should also be zero. the only case that it is not is
when we
have a abrupt change at a time interval, in this case i need to say
that do
two calcuation at this time, once the value should be before abrupt
change
and once at the time time interval calculation with abrupt change .
eg: time(year) 0 0.25 0.5 0.75 1 1.25 1.5
q(load, kpa) 40 40 40 40:60 60 60 60
z=0 40 0 0 0: 20 0 0 0

4. then I have defined that how many layers of soil I have, but I
dont know
how i should apply it here so that for instance, I have four layers
+my z=0
layer, I only did layer one how it could continue down four other
rows and
apply the "formula" to calculate the space between, like this

time(year) 0 0.25 0.5 0.75 1 1.25 1.5
q(load, kpa) 40 40 40 40:60 60 60 60
z=0 40 0 0 0: 20 0 0 0
z=1 use this formual here and do all calculation for the
sapces
available
z=2
z=3
z=4do down like this and stop after it reaches the value that i
have
already defined.

sorry i know its a long question but i would appriciate if you help
me out.