Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If I insert a row in my worksheet, I have to change the row manua
Hello I was wondering if there is a way around this problem.
I have the following code. Public Sub daily2() Dim rng As Range, rng2 As Range Dim sh As Worksheet, sh1 As Worksheet Dim wsheetname As String Dim res As Variant Dim DT As Date, s As String Dim sname As String Worksheets("planning").Select Range("A1").Select I = 10 For g = 1 To 4 For f = 1 To 5 s = Worksheets("planning").Cells(2, 10).Value Range("d2:h75").Copy Worksheets.Add After:=Worksheets(Worksheets.Count) Set sh1 = ActiveSheet sh1.Select ActiveCell.Offset(0, 0).Range("A1").Select ActiveSheet.Paste Link:=True Application.CutCopyMode = False ActiveWindow.DisplayZeros = False Worksheets("planning").Select Range(Cells(2, I), Cells(75, I + 1)).Select Selection.Copy sh1.Select ActiveCell.Offset(0, 5).Range("A1").Select ActiveSheet.Paste Link:=True sname = Range("f1").Value sh1.Name = FORMAT(sname, "ddd") & g L = L + 1 I = I + 2 Next f I = I + 4 Next g Range("1:1").Select End Sub if I add a row in worksheets("planning"), I would then have to manually change Range("d2:h75").Copy Range(Cells(2, I), Cells(75, I + 1)).Select I need to paste as a link also If I add a row in worksheet("planning") I want the new sheet to automatically add a row. Is this possible? thanks in advance Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot insert worksheet in exel - not available in insert menu | Excel Worksheet Functions | |||
insert rows in a worksheet that do not change adjoining rows | Excel Discussion (Misc queries) | |||
Formula not populating from dropdown box.Works when entered manua | Excel Worksheet Functions | |||
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 | Excel Worksheet Functions | |||
Can I auto insert a worksheet when I insert a value in a cell. | Excel Worksheet Functions |