Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am writing a simple macro. I have programmed in years, but thi fairly straight forward. Dim Col As Integer Dim col2 As Integer Dim row As Integer Dim dom As Integer Dim TestRange As Range row = 111 Col = 6 dom = Application.InputBox("What Day of the Month is it?") col2 = Col + dom Set TestRange = Range(Cells(row, Col), Cells(row, col2)) Range("b5").Formula = "=SUM(TestRange)" Range("B5").Select Selection.Copy Range("B6:B13").Select ActiveWindow.SmallScroll Down:=6 Range("B6:B13,B17,B18,B19,B20,B21,B21").Select Range("B21").Activate ActiveWindow.SmallScroll Down:=15 Range("B6:B13,B17,B18,B19,B20,B21,B21,B27,B28,B29, B30,B32,B36,B37,B38").Select Range("B38").Activate ActiveWindow.SmallScroll Down:=9 Range("B6:B13,B17,B18,B19,B20,B21,B21,B27,B28,B29, B30,B32,B36,B37,B38,B42") _ Select Range("B42").Activate ActiveWindow.SmallScroll Down:=6 Range( _ "B6:B13,B17,B18,B19,B20,B21,B21,B27,B28,B29,B30,B3 2,B36,B37,B38,B42,B48,B49,B50,B51,B52,B53 _ ).Select Range("B53").Activate ActiveWindow.SmallScroll Down:=15 Range( _ "B6:B13,B17,B18,B19,B20,B21,B21,B27,B28,B29,B30,B3 2,B36,B37,B38,B42,B48,B49,B50,B51,B52,B53,B61:B64, B67:B69 _ ).Select Range("B67").Activate ActiveWindow.Zoom = 85 ActiveWindow.Zoom = 70 ActiveWindow.Zoom = 55 ActiveWindow.Zoom = 70 ActiveWindow.Zoom = 85 ActiveWindow.Zoom = 100 ActiveWindow.Zoom = 115 ActiveWindow.SmallScroll Down:=63 Range( _ "B6:B13,B17,B18,B19,B20,B21,B21,B27,B28,B29,B30,B3 2,B36,B37,B38,B42,B48,B49,B50,B51,B52,B53,B61:B64, B67:B69,B72:B75,B78:B80,B82:B83 _ ).Select Range("B82").Activate ActiveWindow.SmallScroll Down:=-9 ActiveSheet.Paste ActiveWindow.SmallScroll Down:=-66 Range("B5").Select End Sub Why do i get a @name error when I try to sum my range variable? I think the range is set properly, any help would be appreciated. I' trying to add a dynamic range of cells. the end cell changes based o the day. chri -- ckarama ----------------------------------------------------------------------- ckaramas's Profile: http://www.excelforum.com/member.php...fo&userid=2599 View this thread: http://www.excelforum.com/showthread.php?threadid=39359 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to sort when column is included in range | Excel Discussion (Misc queries) | |||
Unable to Lock a Range | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Unable to set the Locked property of the range class | Excel Programming | |||
Problem trying to us a range variable as an array variable | Excel Programming |