Here is a link to the post on Mr.Excel.

Help with creating a board grid with VB
I have a sheet that calculates how many boxes in one direction and how many boxes in the other direction.
for example , I place the data in early columns and…
www.mrexcel.com
Was able to create a graphic grid as requested but,
On my sheet the cells D3/D5 are not changed directly , so i dont use the enter key. They are a result of a quick formula used to calculate those numbers resulted in D3/D5
from other cells.
When i place data in the cells listed below, the resulting numbers are placed in d3 and d5.
My in put cells are A3/A5 - C3/C5
I use in D3:
=ROUNDDOWN(SUM(C3/A3),0)
and in D5:
=ROUNDDOWN(SUM(C5/A5),0)
So I dont use the enter key for the numbers to change.
and with the code i have the enter key is required
so I would like to place some vb code to replicate enter key so the graphic will update.
thanks in advance.
Code
Sub Make_Board()
Dim Rws As Long, Cols As Long
Const maxSize As Long = 50 '<- tThis would be max. no. or rows and max. no. of columns
Const TopLeftCell As String = "H3" '<-Top left cell of the board
Rws = Range("D3").Value
Application.SendKeys "{return}"
Cols = Range("D5").Value
Application.SendKeys "{enter}"
Application.ScreenUpdating = False
With Range(TopLeftCell).Resize(maxSize, maxSize)
.Interior.Color = xlNone
.Borders.LineStyle = xlNone
If Rws * Cols > 0 Then
With .Resize(Rws, Cols)
.Interior.Color = RGB(200, 200, 200)
.BorderAround LineStyle:=xlContinuous, Weight:=xlThick
With .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThick
End With
With .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThick
End With
End With
End If
End With
Application.ScreenUpdating = True
Application.SendKeys "{enter}"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D3, D5")) Is Nothing Then Make_Board
End Sub
Display More