|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
I am currently writing a spreadsheet using Visual Basic code within. The program is to build a tower model within a finite element software package.... The user inputs the height, inclination, etc, etc.... I have the geometry and members being calculated perfectly... the only thing I need to do now is to produce a text file within STAAD's file structure... ie, certain spacing, etc. etc.... I am having trouble writing this file.... is there a way to write to a file without getting these freakin "" marks all over the place? an example are the nodes... the nodes are calculated and the information needed within staad is joint number, and x,y,z coordinates... all seperated by a space and with ; seperating each joint.... need help with commands to get this info from excel into text file... the vb help that comes with the software is tripe. Any suggestions? Thanks Brian |
|
#2
|
|||
|
|||
|
This drove me crazy too. I ended up putting each sentance of text into its own cell in Column A then looping through the cells and putting the text into a variable which I wrote out to a text file. As an example:
Dim X, Y, Text 'make A1 active so you know where you are. Range ("A1").Activate 'Determine number of cells to copy put count the rows in the CurrentRegion Set SK = ActiveCell.CurrentRegion Y= SK.Rows.Count 'Create the file Open"c:\TestFile.txt" for output as #1 For X = 1 to Y Text = Cells(X,1).text Print #1, Text Next X Close #1 When I finally figured it out it was some of the first output commands I learned in 1980 for BASIC ! Hope this helps |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Trouble Creating Text File from Excel Spreadsheet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|