Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
  #1  
Old November 20th, 2006, 09:07 AM
chapman10s's Avatar
chapman10s chapman10s is offline
**Wanted Wizard**
ASP Free God (5000 - 5499 posts)
 
Join Date: Apr 2006
Location: Who knows...
Posts: 5,410 chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 12139 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 4 Days 12 h 36 m
Reputation Power: 1331
Send a message via AIM to chapman10s Send a message via MSN to chapman10s
VB Formating question --- SIMPLE ?

I have a VB program that i did not write but need to alter slightly. This application exports columns and data to Excel. One column (column L in Excel) formats to currency for some reason (ex $9.90) but it should be a % column (9.90%).

How can I alter my code to get that format?

Code:
Do Until res.EOF

For j = 1 To res.rdoColumns.Count
 
  If j = 8 Then
      wsXL.Cells(i, j).Value = Format(res.rdoColumns(j - 1).Value, "0.00")
  Else
  If res.rdoColumns(j - 1).Name = "dealer_fee" Or res.rdoColumns(j - 1).Name = "manf_fee" Or res.rdoColumns(j - 1).Name = "doc_fee" Then
        wsXL.Cells(i, j).Value = res.rdoColumns(j - 1).Value & "%"
    Else
        wsXL.Cells(i, j).Value = res.rdoColumns(j - 1).Value
    End If
    End If


Any and all help would be greatly appreciated.
__________________
I would rather know than not know at all...



Reply With Quote
  #2  
Old November 20th, 2006, 10:10 AM
pws1970 pws1970 is offline
Contributing User
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Aug 2005
Posts: 3,250 pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)pws1970 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 20017 Folding Title: Starter FolderFolding Points: 20017 Folding Title: Starter Folder
Time spent in forums: 4 Weeks 1 Day 4 h 5 m 50 sec
Reputation Power: 363
I'd run a trace on your condition chapman, put a message box in where you want it to run as % and then step-through your code. Also place a mssg box in the else statement incase this is where its leading too.
Comments on this post
chapman10s agrees: Thanks for the look... already repped you today

Reply With Quote
  #3  
Old November 20th, 2006, 10:29 AM
chapman10s's Avatar
chapman10s chapman10s is offline
**Wanted Wizard**
ASP Free God (5000 - 5499 posts)
 
Join Date: Apr 2006
Location: Who knows...
Posts: 5,410 chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)chapman10s User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 12139 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 4 Days 12 h 36 m
Reputation Power: 1331
Send a message via AIM to chapman10s Send a message via MSN to chapman10s
Thanks for the look. I actually found a simple solution. I was able to call the field from my recordset and just format it that way... Problem solved! Thanks for the look though!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB Formating question --- SIMPLE ?


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT