View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Excel 2007

Maybe...

XL: "Cannot Shift Objects Off Sheet" Error Hiding Columns
http://support.microsoft.com/default...b;en-ca;211769

Remember to look for comments and merged cells.

And for objects that may not be displayed:
xl2003:
tools|options|view tab|Check Show All

xl2007:
Office button|excel options|advanced
Display options for this workbook|For objects|Show|check all

ctrl-6
Should do the same in any version.


Debra Dalgleish has a blog post, too:
http://blog.contextures.com/archives...in-excel-2007/

=============
ps. You have a bug in your code. You'll see it if Sheet1 is not the
activesheet (if the code is in a general module)--or if Sheet1 is not the module
that owns the code.

This line should have the cells() qualified, too:
Sheet1.Range(Cells(1, 8), Cells(NbListClients + 1, 12)) = ListClients

either:
Sheet1.Range(sheet1.Cells(1, 8), sheet1.Cells(NbListClients + 1, 12)) _
= ListClients

or (I like):

with sheet1
.Range(.Cells(1, 8), .Cells(NbListClients + 1, 12)) = ListClients
end with

The leading dots means that that object (.range() or .cells()) belong to the
object in the previous with statement--in this case Sheet1.







vikas wrote:

Hi,

I am getting error in macro.

To prevent possible loss of data, Microsoft Excel cannot shift nonblank
cells off the worksheet.

Below is code

Sheet1.Range(Cells(1, 8), Cells(NbListClients + 1, 12)) = ListClients
' shriyansh
Sheet1.Rows("1:3999").Insert Shift:=xlDown

i need help on this.


--

Dave Peterson