Showing Visitor Messages 1 to 3 of 3
-
Is it possible to take off an attachment that i uploaded for help? I figured out my one reason for not being able to insert rows, and would prefer not to keep my workbook viewable now?
-
Good Afternoon,
I have a macro that each time someone clicks the "Insert Summary Lines"
button I want it to resize the original range. The macro will copy two lines
in the current range and insert them, right now I can only get the code to
select the range and not save it, so when you click on the button again it
reverts back to the old method. Here is my code:
Sub Insert_Rows()
Dim NumRows As Integer
Dim NumColumns As Integer
Dim S As Integer
Dim Summary_Sheet As Range
Dim Sample As Range
NumberofRows = Range("Summary_Sheet").Rows.Count
NumberofColumns = 15
S = 0
Set Sample = Range("Summary_Sheet")
Worksheets("Summary").Activate
Range("First_Cell").Activate
Set Sum_Description = Worksheets("Summary").Columns("C").Rows("7")
Range(Sum_Description.Address).Activate
Range("Summary_Line").Copy
Range("Summary_Line").Insert shift:=xlShiftDown, copyorigin:=True
S = S + 4
Range("Total_Summary").Copy
Range("Total_Summary").Insert shift:=xlShiftDown, copyorigin:=True
Do Until (NumberofRows = NumRows)
If (S > 0) Then
NumRows = NumberofRows + S
NumColumns = NumberofColumns
Range("Summary_Sheet").Resize(Rowsize:=NumRows, ColumnSize:=NumColumns).Select
End If
NumberofRows = NumberofRows + S
Loop
ThisWorkbook.Save
End Sub
Any suggestions>
-
Welcome to The Code Cage!, our aim is to make your visit here as informative and enjoyable as possible. If you have any queries or questions please don't hesitate to ask.
Why not just post me a message to say hello and let me know you visited?