Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 7th, 2003, 10:41 AM
wbrianpower wbrianpower is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 wbrianpower User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post Trouble Creating Text File from Excel Spreadsheet



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

Reply With Quote
  #2  
Old August 8th, 2003, 12:16 AM
Jeff B Jeff B is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 3 Jeff B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Trouble Creating Text File from Excel Spreadsheet


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway