Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting an entire column causes sub to stop

I used the
Selection.EntireColumn.Insert
command at the point where i wanted the column inserted , it inserted
the column and won't process any more steps. Please Help. After
inserting the column, the code just stops and won't go any further
WITHOUT AN ERROR MESSAGE. Please Help

Code follows

Sub addcolumn()

Dim n As Integer
Dim Codecols As Integer
Dim Addcol As Boolean
Dim Delcol As Boolean
Application.Goto Reference:="colOffSet"
n = ActiveCell
Codecols = n + 5
Application.Goto Reference:="addcol"
Addcol = ActiveCell
Application.Goto Reference:="delcol"
Delcol = ActiveCell
Sheets("Ledger").Select
ActiveSheet.Unprotect
'
If Addcol = True Then
Sheets("Ledger").Select
Application.Goto Reference:="R1C" & Codecols
ActiveCell.Activate
Selection.EntireColumn.Insert
Range("B52").Select
Else
If Delcol = True Then
Sheets("Ledger").Select
Application.Goto Reference:="R1C" & Codecols
Selection.EntireColumn.Delete
End If
End If
RefreshRank
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Inserting an entire column causes sub to stop

n2T,
Your codes says after inserting the column to select cell B52
and then run the RefreshRank procedure.
Is cell B52 selected?
Is the RefreshRank procedure running?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"new2Texas"

wrote in message
I used the
Selection.EntireColumn.Insert
command at the point where i wanted the column inserted , it inserted
the column and won't process any more steps. Please Help. After
inserting the column, the code just stops and won't go any further
WITHOUT AN ERROR MESSAGE. Please Help

Code follows

Sub addcolumn()

Dim n As Integer
Dim Codecols As Integer
Dim Addcol As Boolean
Dim Delcol As Boolean
Application.Goto Reference:="colOffSet"
n = ActiveCell
Codecols = n + 5
Application.Goto Reference:="addcol"
Addcol = ActiveCell
Application.Goto Reference:="delcol"
Delcol = ActiveCell
Sheets("Ledger").Select
ActiveSheet.Unprotect
'
If Addcol = True Then
Sheets("Ledger").Select
Application.Goto Reference:="R1C" & Codecols
ActiveCell.Activate
Selection.EntireColumn.Insert
Range("B52").Select
Else
If Delcol = True Then
Sheets("Ledger").Select
Application.Goto Reference:="R1C" & Codecols
Selection.EntireColumn.Delete
End If
End If
RefreshRank
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Inserting an entire column causes sub to stop

Try stepping through the code manually to see if it goes to the RefreshRank
line. Since your references are not available it is difficult for me to see
what happens, but it looks like it would step all the way through, if your
GoTo references are valid.

"new2Texas" wrote:

I used the
Selection.EntireColumn.Insert
command at the point where i wanted the column inserted , it inserted
the column and won't process any more steps. Please Help. After
inserting the column, the code just stops and won't go any further
WITHOUT AN ERROR MESSAGE. Please Help

Code follows

Sub addcolumn()

Dim n As Integer
Dim Codecols As Integer
Dim Addcol As Boolean
Dim Delcol As Boolean
Application.Goto Reference:="colOffSet"
n = ActiveCell
Codecols = n + 5
Application.Goto Reference:="addcol"
Addcol = ActiveCell
Application.Goto Reference:="delcol"
Delcol = ActiveCell
Sheets("Ledger").Select
ActiveSheet.Unprotect
'
If Addcol = True Then
Sheets("Ledger").Select
Application.Goto Reference:="R1C" & Codecols
ActiveCell.Activate
Selection.EntireColumn.Insert
Range("B52").Select
Else
If Delcol = True Then
Sheets("Ledger").Select
Application.Goto Reference:="R1C" & Codecols
Selection.EntireColumn.Delete
End If
End If
RefreshRank
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop toolbar drop box of entire cell contents cubanmamma Excel Discussion (Misc queries) 1 April 30th 10 08:32 PM
How do I stop Excel from auto-inserting a date? Samson Huang Excel Discussion (Misc queries) 1 July 5th 08 04:22 PM
Inserting worksheet makes formulae stop working Mark Excel Discussion (Misc queries) 5 April 24th 08 07:10 PM
inserting rows in entire sheet add Excel Discussion (Misc queries) 1 March 30th 07 04:10 PM
Inserting Entire Rows TP[_4_] Excel Programming 1 June 25th 04 03:17 PM


All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"