Thread: offset problems
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
cornishbloke[_12_] cornishbloke[_12_] is offline
external usenet poster
 
Posts: 1
Default offset problems

Thank you Leo and Tomek,

I'm still new to VBA and so sometimes even obvious mistakes don't stand
out to me - the problem was indeed that I didn't see I was offsetting
from the sheet and not the range. The code I've used (which works
perfectly) is as follows:-

Sub addrow()
'
'
Sheets("Row Template").Range("A1:G6").Copy
With Sheets("Quote").Range("insertpoint")
..Insert Shift:=xlDown
..Offset(-5, 0).Value = .Offset(-11, 0).Value + 1
End With
Sheets("Quote").PageSetup.PrintArea =
"$A$1:(offset(insertpoint,1,6))"
'
'
End Sub

I only hope that as I learn more I about VBA I can contribute and help
others as much as this forum helps me!

Have a happy New Year!


---
Message posted from http://www.ExcelForum.com/