Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Group,
I'm inserting rows via vba with the line: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlShiftDown This method works perfectly with Excel 2000 but generates an error in 97. Any ideas? Sean |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sean,
How about trying: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlDown xlShiftDown isn't a constant in Excel. Hope it works. E. Froma |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi E Foma,
From the intermediate wuindow: ?xlShiftDown -4121 ?xlDown -4121 --- Regards, Norman "E. Froma" wrote in message ... Sean, How about trying: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlDown xlShiftDown isn't a constant in Excel. Hope it works. E. Froma |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman,
You're right. Both are constants in Excel 2000. Maybe not in '97? E. Froma "Norman Jones" wrote: Hi E Foma, From the intermediate wuindow: ?xlShiftDown -4121 ?xlDown -4121 --- Regards, Norman "E. Froma" wrote in message ... Sean, How about trying: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlDown xlShiftDown isn't a constant in Excel. Hope it works. E. Froma |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi E Froma,
xlShiftDown is valid in xl97. I do not have a loaded copy of xl97 to hand, but I am sure that a Google groups search limited to pre-2000 posts would confirm. --- Regards, Norman "E. Froma" wrote in message ... Norman, You're right. Both are constants in Excel 2000. Maybe not in '97? E. Froma "Norman Jones" wrote: Hi E Foma, From the intermediate wuindow: ?xlShiftDown -4121 ?xlDown -4121 --- Regards, Norman "E. Froma" wrote in message ... Sean, How about trying: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlDown xlShiftDown isn't a constant in Excel. Hope it works. E. Froma |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sean,
What error are you getting and how have you set RangeRow? I assume that the your code is a single line which has wrapped in the post. --- Regards, Norman "Sean T." wrote in message ... Hello Group, I'm inserting rows via vba with the line: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlShiftDown This method works perfectly with Excel 2000 but generates an error in 97. Any ideas? Sean |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
set RangeRow = Range("B9")
intNumRows = 5 RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlShiftDown worked fine for me in Excel 97. You must have made some other error or the sheet is protected. -- Regards, Tom Ogilvy "Sean T." wrote in message ... Hello Group, I'm inserting rows via vba with the line: RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlShiftDown This method works perfectly with Excel 2000 but generates an error in 97. Any ideas? Sean |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to all responders,
And, I apologize for getting back so late (Work continues on the weekend). Tom, I verified that the sheet was not protected and still am unable to run the code below. There is no problem inserting the rows manually but, without the error check, the macro comes to a hault at the resize line. Option Explicit Sub NewTask() Dim RangeCounter As Range Dim RangeRow As Range Dim strIndex As String Dim intNumRows As Integer Application.ScreenUpdating = False For Each RangeCounter In Range("A:A") If RangeCounter.Value = "Index" Then intNumRows = 4 'Temp assignment strIndex = RangeCounter.Row Set RangeRow = Range("A" & strIndex) On Error GoTo ErrBailOut RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlShiftDown Exit For End If Next ErrBailOut: Set RangeRow = Nothing Application.ScreenUpdating = True End Sub Sean "Tom Ogilvy" wrote: set RangeRow = Range("B9") intNumRows = 5 RangeRow.EntireRow.Resize(intNumRows).Insert shift:=xlShiftDown worked fine for me in Excel 97. You must have made some other error or the sheet is protected. -- Regards, Tom Ogilvy |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() O'boy, After further testing the problem has become more convoluted. I closed and reopened the file and was able to run the code posted above from the VBAIDE. When I attempted to run the code via a "Command Button", the problem line generated an error. Not only that but the line now generated an error back in the IDE. I repeated the Close/Open but could not get it to run in the IDE. I substituted in Tom's code and got it to run once before it too started to fail with the inclusion of a "Command Button". Perhaps it would be easier to upgrade the old laptop with a more modern Excel install. I do appreciate the assistance, Sean |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's a bug in xl97 that can be resolved by changing the .takefocusonclick
property of the commandbutton to false. Or you can add: activecell.activate at the top of the code. It was fixed in xl2k. Sean T. wrote: O'boy, After further testing the problem has become more convoluted. I closed and reopened the file and was able to run the code posted above from the VBAIDE. When I attempted to run the code via a "Command Button", the problem line generated an error. Not only that but the line now generated an error back in the IDE. I repeated the Close/Open but could not get it to run in the IDE. I substituted in Tom's code and got it to run once before it too started to fail with the inclusion of a "Command Button". Perhaps it would be easier to upgrade the old laptop with a more modern Excel install. I do appreciate the assistance, Sean -- Dave Peterson |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once again, thanks for all of the replies,
Mr. Peterson did hit upon the cause of my problem and his recommendation has my worksheet up and running again. Perhaps I'll keep Excel97 around just a little bit longer. Sean -----Original Message----- There's a bug in xl97 that can be resolved by changing the .takefocusonclick property of the commandbutton to false. Or you can add: activecell.activate at the top of the code. It was fixed in xl2k. Dave Peterson . |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sometimes when you include the name of the procedure or how it's called, you'll
get a correct answer more quickly. That's the reason I could post the correct response. (You previous message had that info in it.) (Glad you got it working.) wrote: Once again, thanks for all of the replies, Mr. Peterson did hit upon the cause of my problem and his recommendation has my worksheet up and running again. Perhaps I'll keep Excel97 around just a little bit longer. Sean -----Original Message----- There's a bug in xl97 that can be resolved by changing the .takefocusonclick property of the commandbutton to false. Or you can add: activecell.activate at the top of the code. It was fixed in xl2k. Dave Peterson . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How calculate a difference btwn 2 TextBox and insert the result inthe appropriate cell | Excel Discussion (Misc queries) | |||
Cannot insert worksheet in exel - not available in insert menu | Excel Worksheet Functions | |||
subtract the time difference from another time difference | Excel Discussion (Misc queries) | |||
Insert Next? Or insert a variable number of records...how? | Excel Discussion (Misc queries) | |||
charting a difference of 2 columns' w/o adding a difference column | Charts and Charting in Excel |