作者:苏佡挖图组糖最棒 | 来源:互联网 | 2023-09-05 14:04
Imtryingtocreateaprogramthatoptimizeshistogrambinwidthbeforethatthough,Ineedhelp
I'm trying to create a program that optimizes histogram bin width...before that though, I need help with a seemingly simple task - setting a Range mentioned in a cell into a VBA array.
我正在尝试创建一个程序来优化直方图栏的宽度……在此之前,我需要帮助完成一个看似简单的任务——将单元格中提到的范围设置为VBA数组。
I'd like the data for the histogram to be on any sheet, in this case 'Data'!B4:M12. This is mentioned in D4 of the sheet I want the histogram to appear on. I keep getting an error when I run my code though, even after changing it multiple times. There's clearly a syntax error that I don't know how to handle.
我希望直方图的数据在任何表格上,在这种情况下是“数据”!B4:M12。这是在表格D4中提到的我想要直方图出现在上面。当我运行我的代码时,即使在多次修改之后,我仍然会得到一个错误。很明显,有一个语法错误我不知道如何处理。
Any assistance would be much appreciated!
如有任何帮助,我们将不胜感激!
Sub Histogram_Shimazaki_Shinomoto()
Dim data_range As String, min_bins As Integer, max_bins As Integer
Dim Data()
Dim x_min As Double, x_max As Double
data_range = Cells(4, 4) ' data range
min_bins = Cells(5, 4) ' min # of bins
max_bins = Cells(6, 4) ' max # of bins
Set Data = Range(data_range)
x_min = WorksheetFunction.Min(Data)
MsgBox x_min
End Sub
1 个解决方案