Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 08-26-2020, 09:14 PM
leeqiang leeqiang is offline Problems with vba frequency distribution histogram Windows 10 Problems with vba frequency distribution histogram Office 2019
Advanced Beginner
Problems with vba frequency distribution histogram
 
Join Date: Aug 2020
Posts: 49
leeqiang is on a distinguished road
Default

but when i use the code as follws,some questions happened:
Sub copyd()
Dim p, q
Columns("k:l").ClearContents
p = ActiveSheet.Cells.Rows.Count
q = ActiveSheet.Cells(p, 4).End(xlUp).Row
Range("D1" & q - 1).Select
Selection.Copy
Range("K1").Select
ActiveSheet.Paste
Range("G1:G" & q - 1).Select
Application.CutCopyMode = False
Selection.Copy
Range("L1").Select
ActiveSheet.Paste

Dim chtChart As Chart
Set chtChart = Charts.Add
With chtChart
.SetSourceData Source:=ActiveSheet.[k1].CurrentRegion, PlotBy:=xlRows
.ChartType = xlColumnClustered
.HasDataTable = True
.ApplyDataLabels
.HasTitle = True
.ChartTitle.Text = "histogram"
.HasLegend = False
.Name = "histogram"
End With
Set chtChart = Nothing
End Sub


application alert:
20200827121045.png
histogram each colunm have space between each other,and the column have the some color,not the different colours:
20200827120955.png
Reply With Quote
 

Tags
histogram



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to draw the histogram? leeqiang Excel Programming 1 08-27-2020 05:19 PM
Problems with vba frequency distribution histogram Frequency of Count Ifs keeble Excel 4 02-01-2017 10:33 AM
Formula to calculate Frequency lwls Excel 1 03-30-2015 05:40 AM
Problems with vba frequency distribution histogram Trying to count frequency borninscorpio Excel 4 07-31-2013 12:44 AM
Frequency of a name bryant03 Excel 1 06-27-2012 10:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft