Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error: Nonblank cells cannot be shifted off the spreadsheet.
Hi,
I am trying to add a new row to the grid for which I have a Add button on my page. When i click this add button an error message pops up as Error: Nonblank cells cannot be shifted off the spreadsheet.. If i comment the Autofilter part in my onload procedure, i won't get the error message, but i need this filter for the first row. Could help me on this? Sub Window_onLoad() With objOWC .ViewableRange = objIntelOWC.ActiveSheet.UsedRange.Address .Titlebar.caption = "Loading Data..." .ActiveSheet.Name = "Company" .DisplayOfficeLogo = False .DisplayTitleBar = True .DisplayToolbar = False .DisplayRowHeadings = True .DisplayColumnHeadings = False .DisplayVerticalScrollBar = False .DisplayHorizontalScrollBar = False .ActiveSheet.Cells(1,1).value = "Company Code" .ActiveSheet.Cells(1,2).value = "Company Description" .ActiveSheet.Rows(1).AutoFilter 'Problem line .AutoFit = True .ViewableRange = objIntelOWC.ActiveSheet.UsedRange.Address .Titlebar.caption = "Done!" .ActiveSheet.Protection.Enabled = True End With End Sub sub btnAdd_onClick() dim RowAdd objOWC.ActiveSheet.Protection.Enabled = False objOWC.TitleBar.Caption = "Adding Row" with objOWC RowAdd = .ActiveSheet.UsedRange.Rows.Count+1 .Rows(RowAdd).insert .ActiveSheet.UsedRange.Rows.AutoFit end with objOWC.TitleBar.Caption = "Done!" objOWC.ActiveSheet.Protection.Enabled = True end sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error message "cannot shift nonblank cells off the worksheet" | Excel Discussion (Misc queries) | |||
can't shift nonblank cells off the page error | Excel Discussion (Misc queries) | |||
tally of nonblank cells | Excel Worksheet Functions | |||
Run-time error 1004: Cannot shift nonblank cells off the worksheet | Excel Discussion (Misc queries) | |||
Adding NonBlank Cells | Excel Worksheet Functions |