S
Scott Halper
I have written some code in order to be able to lock the file but have
a macro insert a row when needed. I am having a problem because each
time the row is inserted it is hidden so I would like to have the new
adjusted row's rowheigh set so that it will be able to be seen. I
have posted my code so far below. Thanks in advance of your help.
I believe that the RowHeight has to be used in conjuction with the
Rows object. I'm just not sure how to have excel select the new
inserted row (which is directly above NFP_Insert). I thougth about
having it find the row number of NFP_Insert and then subtract one to
find the newly inserted row, however, I was unsuccessful at that as
well.
Private Sub NFP_Blank_Click()
Const PWORD As String = "123456"
Application.ScreenUpdating = False
With Worksheets("Southeast - NFP")
.Unprotect Password:=PWORD
.Range("Dist_Blank_NFP").Copy
.Range("NFP_Insert").Insert Shift:=xlUp
.RowHeight = 12.75
Application.CutCopyMode = False
.Range("Total_NFP").Select
.Protect Password:=PWORD
End With
Application.ScreenUpdating = True
End Sub
Thanks,
Scott
a macro insert a row when needed. I am having a problem because each
time the row is inserted it is hidden so I would like to have the new
adjusted row's rowheigh set so that it will be able to be seen. I
have posted my code so far below. Thanks in advance of your help.
I believe that the RowHeight has to be used in conjuction with the
Rows object. I'm just not sure how to have excel select the new
inserted row (which is directly above NFP_Insert). I thougth about
having it find the row number of NFP_Insert and then subtract one to
find the newly inserted row, however, I was unsuccessful at that as
well.
Private Sub NFP_Blank_Click()
Const PWORD As String = "123456"
Application.ScreenUpdating = False
With Worksheets("Southeast - NFP")
.Unprotect Password:=PWORD
.Range("Dist_Blank_NFP").Copy
.Range("NFP_Insert").Insert Shift:=xlUp
.RowHeight = 12.75
Application.CutCopyMode = False
.Range("Total_NFP").Select
.Protect Password:=PWORD
End With
Application.ScreenUpdating = True
End Sub
Thanks,
Scott