ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   data table function (https://www.excelbanter.com/excel-programming/396408-data-table-function.html)

dstiefe

data table function
 
how do i call the data table function in VBA?

Thank you

Michael

data table function
 
Try this:

Sub Test()

Set dataTableRange = Worksheets("Sheet1").Range("A1:K11")
Set rowInputCell = Worksheets("Sheet1").Range("A12")
Set columnInputCell = Worksheets("Sheet1").Range("A13")

Worksheets("Sheet1").Range("A1").Formula = "=A12*A13"
For i = 2 To 11
Worksheets("Sheet1").Cells(i, 1) = i - 1
Worksheets("Sheet1").Cells(1, i) = i - 1
Next i
dataTableRange.Table rowInputCell, columnInputCell
With Worksheets("Sheet1").Range("A1").CurrentRegion
.Rows(1).Font.Bold = True
.Columns(1).Font.Bold = True
.Columns.AutoFit
End With

End Sub
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"dstiefe" wrote:

how do i call the data table function in VBA?

Thank you



All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com