I have a form with several input boxes in it. Code for each input looks like this:
Sub addslabthk()
Application.ScreenUpdating = False
'
'addslabthk macro
'
Dim i, k As Long
i = 1
k = AddHorizontalItemForm.TextBox2
For i = 1 To k
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(0, -88).Range("A1").FormulaR1C1 = "=RC[89]"
ActiveCell.Offset(0, -67).Range("A1").FormulaR1C1 = "=RC[70]"
ActiveCell.Offset(0, -61).Range("A1").FormulaR1C1 = "=feet(RC[62])*12"
ActiveCell.Offset(0, 1).Range("A1").FormulaR1C1 = "slab Thick"
ActiveCell.Offset(1, 0).Range("A1").Select
Next i
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Application.CutCopyMode = False
End Sub
_____________________________________________________________
I have just added checkboxes to my form next to each input box with a header of "No Row" If checked, I want to eliminate this part of the code:
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Application.CutCopyMode = False
______________________________________________________________
I currently am using:
Sub addslab()
Application.ScreenUpdating = False
'
'addslab macro
'
'
Dim i, k As Long
i = 1
k = AddHorizontalItemForm.TextBox1
For i = 1 To k
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(0, -88).Range("A1").FormulaR1C1 = "=RC[89]"
ActiveCell.Offset(0, -86).Range("A1").FormulaR1C1 = "=RC[89]"
ActiveCell.Offset(0, -61).Range("A1").FormulaR1C1 = "=feet(RC[62])*12"
ActiveCell.Offset(0, 1).Range("A1").FormulaR1C1 = "SLAB"
ActiveCell.Offset(1, 0).Range("A1").Select
'If CheckBox1.Value = False Then
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Application.CutCopyMode = False
'If CheckBox1.Value = True Then
Next i
End Sub
______________________________________________________________
However, regardless if the box is checked or not, it still leaves a blank row on the chart as the above code tells it. Is something off with my "If-Then?" Thanks.
Sub addslabthk()
Application.ScreenUpdating = False
'
'addslabthk macro
'
Dim i, k As Long
i = 1
k = AddHorizontalItemForm.TextBox2
For i = 1 To k
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(0, -88).Range("A1").FormulaR1C1 = "=RC[89]"
ActiveCell.Offset(0, -67).Range("A1").FormulaR1C1 = "=RC[70]"
ActiveCell.Offset(0, -61).Range("A1").FormulaR1C1 = "=feet(RC[62])*12"
ActiveCell.Offset(0, 1).Range("A1").FormulaR1C1 = "slab Thick"
ActiveCell.Offset(1, 0).Range("A1").Select
Next i
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Application.CutCopyMode = False
End Sub
_____________________________________________________________
I have just added checkboxes to my form next to each input box with a header of "No Row" If checked, I want to eliminate this part of the code:
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Application.CutCopyMode = False
______________________________________________________________
I currently am using:
Sub addslab()
Application.ScreenUpdating = False
'
'addslab macro
'
'
Dim i, k As Long
i = 1
k = AddHorizontalItemForm.TextBox1
For i = 1 To k
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(0, -88).Range("A1").FormulaR1C1 = "=RC[89]"
ActiveCell.Offset(0, -86).Range("A1").FormulaR1C1 = "=RC[89]"
ActiveCell.Offset(0, -61).Range("A1").FormulaR1C1 = "=feet(RC[62])*12"
ActiveCell.Offset(0, 1).Range("A1").FormulaR1C1 = "SLAB"
ActiveCell.Offset(1, 0).Range("A1").Select
'If CheckBox1.Value = False Then
ActiveCell.Rows("1:1").EntireRow.Copy
ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Application.CutCopyMode = False
'If CheckBox1.Value = True Then
Next i
End Sub
______________________________________________________________
However, regardless if the box is checked or not, it still leaves a blank row on the chart as the above code tells it. Is something off with my "If-Then?" Thanks.