Hi rnordquest
I have set up a file to do what you wish to.
This is how it will work:
1. Clear any data from previous runs
2. Paste your lines of data starting from range A1
3. Click the 'Run' button
Tha macro will parse the data and put the equation corresponding to each line of data in column...
Kris,
The code I wrote was in Excel VBA - for which the Excel objects like Workbook, Worksheet etc are native. When using the code from any other VB/VBA environment you need to set reference to the Excel object library and declare the variables as johnwm has suggested.
Mala Singh
'Dare to...
I do not think you need to learn VBA to be able to do this.
It is enough to set up the worksheet with an input area comprising the input variables (pipe dia, liquid level etc) and an output area which will contain formulas (for theta, wetted area etc).
The formulas in the output section would...
LumpoDelMagnifico,
I am not good at languages other than English - but I suspect 'LumpoDelMagnifico' is Spanish?
Can you translate this for me? I just want to verify if it really means what I suspect it is meant to mean...I am not divulging my guess lest someone red-flags this post!!
Mala...
Sorry, forgot another item - why use a function to which an array needs to be passed? why not just place the two lines of code (in the function) in the original (calling) point...
Mala Singh
'Dare to Imagine'
You cannot ReDim Preserve an array without initially declaring it with a Dim statement. Also your function indicates that the array is initialized elsewhere - the point which is calling the function.
At this point you need to declare the array with a Dim statement - e.g. Dim MyArray().
After...
You need to use code like:
Sub OpenFiles()
Dim CurrentDwg As AcadDocument
Dirname = "C:\Documents and Settings\Mala Singh\My Documents\"
Dim DwgNames(1 To 10)
DwgNames(1) = "Dwg1"
DwgNames(2) = "Dwg2"
DwgNames(3) = "Dwg3"
DwgNames(4) = "Dwg4"
DwgNames(5) = "Dwg5"...
Use version-dependent ProgIDs.
For example, if you are using CreateObject, instead of :
CreateObject ("AutoCAD.Application"), use
CreateObject ("AutoCAD.Application.16") for AutoCad2004.
For AutoCAD 2002, use CreateObject ("AutoCAD.Application.15").
Mala Singh
'Dare to Imagine'
Yes, a user defined function would be much cleaner.
Added advantage: You would not have to type such a long formula everytime.
You could use the following code
Function JoinCells(cell1 As Range, ParamArray Addr()) As String
JoinCells = cell1.Text
If Len(JoinCells) > 0 Then JoinCells =...
You can concatenate up to 30 cells (I do not think yu will need to do it for more).
If you need the result to show the cell values separated with underscores, the following would be a better way...