A
Arnold
Hello,
I have a problem similar to that in the thread "Problems deleting
columns" on Jul. 2. The recommendations, and resolution at
http://support.microsoft.com/default.aspx?kbid=211769 do not work in
my case. My sheet will probably contain up to cols. DD or EE, but
will never go to IV. There is no data in IV. However, I have
inserted conditional formatting and have filled rows/columns. I
continue to get the run-time error 1004 "To prevent the possible loss
of data, Microsoft Excel cannot shift nonblank cells off the
worksheet..." error. This is stumping me; any ideas?
Thanks,
Arnold
Sub mcrActivities()
Sheets("Fields").Select
Dim ActivityDate As Range
Set ActivityDate = ActiveSheet.Range("C11")
ActivityDate.Value = Date
Columns("C:C").Select
Selection.Copy
Sheets("Quarter").Select
lastcolumn = ActiveSheet.Cells.Find(what:="Activity",
searchorder:=xlByColumns, searchdirection:=xlPrevious).Column
ActiveSheet.Cells(lastcolumn + 1).Offset(12, 0).Select
' Modified code to place new columns in front of the last column
with the text "Activity" in it on row 12; in the AAs.
ActiveSheet.Cells(lastcolumn).Offset(0, 0).EntireColumn.Insert
' Code to place the focus after a column insert.
ActiveSheet.Cells(lastcolumn).Offset(8, 0).Select
End Sub
I have a problem similar to that in the thread "Problems deleting
columns" on Jul. 2. The recommendations, and resolution at
http://support.microsoft.com/default.aspx?kbid=211769 do not work in
my case. My sheet will probably contain up to cols. DD or EE, but
will never go to IV. There is no data in IV. However, I have
inserted conditional formatting and have filled rows/columns. I
continue to get the run-time error 1004 "To prevent the possible loss
of data, Microsoft Excel cannot shift nonblank cells off the
worksheet..." error. This is stumping me; any ideas?
Thanks,
Arnold
Sub mcrActivities()
Sheets("Fields").Select
Dim ActivityDate As Range
Set ActivityDate = ActiveSheet.Range("C11")
ActivityDate.Value = Date
Columns("C:C").Select
Selection.Copy
Sheets("Quarter").Select
lastcolumn = ActiveSheet.Cells.Find(what:="Activity",
searchorder:=xlByColumns, searchdirection:=xlPrevious).Column
ActiveSheet.Cells(lastcolumn + 1).Offset(12, 0).Select
' Modified code to place new columns in front of the last column
with the text "Activity" in it on row 12; in the AAs.
ActiveSheet.Cells(lastcolumn).Offset(0, 0).EntireColumn.Insert
' Code to place the focus after a column insert.
ActiveSheet.Cells(lastcolumn).Offset(8, 0).Select
End Sub