Solved

Format a bunch of values to currency in a msflexgrid

Posted on 2014-01-19
4
295 Views
Last Modified: 2014-01-19
This works, but their may be an easier way to write it
i am loading from a saved udt and a lot of the values need formatting as currency, but not all
gridCardStats.TextMatrix(5, 1) = .tmpLost
    gridCardStats.TextMatrix(5, 1) = Format(gridCardStats.TextMatrix(5, 1), "Currency")
is there a better way to write this ?
0
Comment
Question by:isnoend2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39792323
Instead of

gridCardStats.TextMatrix(5, 1) = .tmpLost
    gridCardStats.TextMatrix(5, 1) = Format(gridCardStats.TextMatrix(5, 1), "Currency")

just do

gridCardStats.TextMatrix(5, 1) = Format(.tmpLost, "Currency")
0
 

Author Closing Comment

by:isnoend2001
ID: 39793325
thanks. thought there was a better way, been doing it the hard for a long time
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 39793348
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2013
0
 

Author Comment

by:isnoend2001
ID: 39793377
Thanks i am posting another question where i want to show just the part of a file name  after the last "\"
Hopefully you can answer
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month5 days, 15 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question