PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, August 11, 2022

[FIXED] How to change decimal on x-axis (i.e. scatter graph), using VBA?

 August 11, 2022     decimal, excel, vba     No comments   

Issue

I was searching for how to change decimal, using VBA and I found the excellent answer below.

https://stackoverflow.com/a/32462504/9653254

However, for my graph, it is a scatter graph. So I need to change decimal on x-axis. Above code only change y-axis. Could you let me know how to change deciaml on x-axis?

Thank you in advance.

Dim obj     As Object
For Each obj In ActiveSheet.ChartObjects
   With obj.Chart.Axes(xlValue)
      .TickLabels.NumberFormat = "0.00"
   End With
Next obj

End Sub

Solution

I found answer, thanks to @Ahmed AU

The code is the below. Thank you for your comment.

Sub xydecimal()

  Dim obj     As Object
For Each obj In ActiveSheet.ChartObjects
   With obj.Chart.Axes(xlValue)
   .TickLabels.NumberFormat = "0.00"
      End With
   With obj.Chart.Axes(xlCategory)
    .TickLabels.NumberFormat = "0.00"            
   End With
Next obj

End Sub


Answered By - Jin.W.Kim
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing