-1

I have a VBA program which copies charts from Excel to Word.
Only later did I notice that the bar positions are not in the correct order.

How can we change the positions of the bars in a barchart?
Hope this picture below explains my problem.

enter image description here

I simply want to swap them. I tried to drag and all in Word, but it didn't work.

M--
  • 25,431
  • 8
  • 61
  • 93
Abdul Shiyas
  • 401
  • 3
  • 9
  • 30

2 Answers2

1

The order of the bars is governed by the order of the source data. You can't just drag the bars around. Instead, edit the chart source data and make the desired changes.

By default, the value at the top of the source data will be plotted closest to the X axis. Keep that in mind when re-ordering the data.

enter image description here

As mentioned in a comment, you can also edit the data source and change the order of several data series in a chart, .... BUT

  • If there is only ONE series, you still need to sort the data in the source table.
  • if there are several series, Excel for Windows will allow you to sort the series in the data source dialog, but Excel for Mac won't. On a Mac you will need to edit the series formula in the formula bar and manually change the last parameter, which governs the series order.
teylyn
  • 34,374
  • 4
  • 53
  • 73
  • Actually, it is possible (at least on the newer Windows versions of Excel) to reorder the data series in the chart separately from changing the order in the underlying data: see [this SO post](http://stackoverflow.com/a/5161726/4895877). – Brendan Jun 18 '15 at 05:08
  • 1
    @Brendan, not with only one data series, as was posted in the original question. I've added a few thoughts about series ordering in my answer. – teylyn Jun 18 '15 at 09:56
  • Ah, correct you are. Apologies for the confusion. – Brendan Jun 18 '15 at 13:10
0
  1. Right click on graph;

enter image description here

  1. Select, Select Data;

enter image description here

  1. Using arrow keys (Up & Down), you can rearrange the data bars on graph
M--
  • 25,431
  • 8
  • 61
  • 93
amilali
  • 13
  • 3