Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CODE FOR SHEET MODULE
Hi I have this macro (please see below) which is on a button in sheet.
It works fine. I want to put this macro in Sheet module so if I copy this sheet some where else so the macro will get copied too. Where as I cant do it now Sub InsertLines() Dim LastRow As Long Dim StartRow As Long StartRow = Cells(Rows.Count, 2).End(xlUp).Row - 1 Cells(StartRow + 1, 1).Resize(6, 1).EntireRow.Insert For i = 1 To 6 Cells(StartRow + i, 9).Resize(1, 6).Merge Next i LastRow = Cells(Rows.Count, 2).End(xlUp).Row Application.ScreenUpdating = False With Range(Cells(StartRow, 2), Cells(LastRow, 2)) ..DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _ Step:=1, Trend:=False End With Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to change code in a sheet and workbook module | Excel Programming | |||
Sheet Code Module: copying code to | Excel Programming | |||
Sheet code module question | Excel Programming | |||
Reference Addin Module from sheet code | Excel Programming | |||
Write VBA code into a sheet module using VBA | Excel Programming |