-
Solved: Help with Code
I am trying to get code to display text on one line and a percent on the line below it...The code that I have this far will allow combining a text and percent field, but I want them to display like this:
Test
25%
This code:
[vba]
=B19&TEXT(D19," #%")
[/vba]
Places them side by side, how can I add a line break or carraige return or whatever to make the percent go under the text?
Last edited by Aussiebear; 11-03-2011 at 02:37 AM.
Reason: adjusted the code tags for the correct usage
-
Of course you need the cell format Wrap Text set.
=B19&CHAR(10)&TEXT(D19," #%")
-
Kenneth that code adds the pipe character between my text and my percentage, not an actual return. Is that formatting that I need to change?
-
I should have added a box character if you did not set the Wrap Text format as I explained.
-
Good Gravy, once I added the wrap text it worked just as you said it would. Thank you for your help!!!
-
Actually let me ask this since this was the purpose for me wanting this information...I have pie charts based off of Access Queries. Well when the percentage on the query updates the pie chart doesn't always update. So what I was going to do for a "Band-Aid" was to input the formula above as the pie chart tag so that when the percentage in the query updates, so will the percentage on the chart.
Does that sound feasible, or am I way out in left field on that one?
-
You can ask that in another thread.
It could be something simple. I would suggest that you make a simple access file and an excel file with the chart. I know that that can take a bit of effort but it helps us help you more quickly and accurately. Sounds like you just need to update the chart series.
-
One more question pertaining to this code:
[vba]
=B19&CHAR(10)&TEXT(D19," #%")
[/vba]
If it is showing 0% when I input that code it is just showing a % sign, what needs to be added in order to force it to show 0 if null?
Last edited by Aussiebear; 11-03-2011 at 02:38 AM.
Reason: adjusted the code tags for the correct usage (...Again)
-
=If(D10="",B19&CHAR(10)& "0%",B19&CHAR(10)&TEXT(D19," #%"))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules