How to make space between bars in a graph?

  • Thread starter Thread starter Amit
  • Start date Start date
A

Amit

Hello Group,

1) does anybody know how to create gaps between bars in graph using VBA
coding?
2) also, how can I make them have same color rahter different colors ?
3 ) How to make it ready only in a way that doesn't let use copy or
paste thing at all? this applies to chart and also to sheet page.

Thanks,
AK
 
1) Could you give us the code you're using to create the graph? That
would make it easier to help you.

3) You could intercept the copy keystroke, but that will only slow a
user down. Print Screen would allow the user to take a picture of the
screen and paste as a picture. Depending on how badly the user wants a
copy of it, they could even take a picture of the screen with a digital
camera. I used that technique once when my computer had a blue screen
of death, and I needed to know the error information.

HTH,
Chris M.
 
Hi BeWyched ,

Thank you so much for your response. The gapwidth works nicely but the
interior.color property doesn't cause any effect. Am I missing
something here?


However, as one of you had asked for the source code I have posted here
as following:

Dim TheChart As Chart
Dim DataSheet As Worksheet
Dim CatTitles As Range
Dim SrcRange As Range
Dim SourceData As Range

Set TheChart = Sheets("Chart1")
Set DataSheet = Sheets("Sheet1")

With DataSheet
Set CatTitles = .Range("B7:B7")
Set SrcRange = .Range(Cells(8, Item), _
.Cells(38, Item))
End With


Set SourceData = Union(CatTitles, SrcRange)

TheChart.ChartArea.Width = 2


With TheChart

.SetSourceData Source:=SourceData, PlotBy:=xlColumn
.ChartTitle.Left = TheChart.ChartArea.Left
.ApplyDataLabels xlDataLabelsShowValue
.ChartGroups(1).Overlap = -50
.ChartGroups(1).GapWidth = 150

.Deselect

End With
 
Hi BeWyched,

Thanks! yes it works now I tried the loop you had pointed. As I said
works just fine only it flickers when goes thru the loop to change
color of each bar.

One more thing I need to ask is that how can I process a text? for
instance I send a request to a server and it sends me back some
strings. These strings are like:

App Key (*)
Search eng (*/*)(*/*)
and so on ...
I need to filter out those wild cards. What functionality of VBA can
hlep me to wipe them out?

Thanks again for your concern and helping me out with my question.

Thanks,
AK
 
Hi BeWyched,

Thanks indeed for your response and also thanks for your code sample.
However, I'm using a replace() now and it just removes them. Do you
suggest it or should I go with your method?

Thanks and wish you wonderful weekend.
 
Thanks again. One more question so far I believe I have learnt
something but one thing doesn't make sense to me. I have created two
button on sheet1. Now when I save it as add-in and plug into an Excel
environment it doesn't show up the buttons at all.

Why causes this? have I missed something?

Thanks for follow up.

Amit
 
Thank you :)


Hi Amit

Your question is specific to Excel - this is an Access forum! Excel VBA and
Access VBA are the same so I could answer your previous questions but,
unfortunately, I'm not familiar with front-end Excel (not at a techniocal
level anyway).

I suggest you post your question on the Excel forum.

Regards and good luck.

BW
 
Back
Top