|
-
Oct 1st, 2003, 08:50 AM
#1
Thread Starter
New Member
Excel, end column plus 1
i would like to move to the column after the last column that contains data, but with out specifying a column letter to enure that this postion will be kept should any other colmns be added resulting in the very end column becoming a different letter. Can anyone provide any advice or even better some code for me to acheive this. this could be very simple but im not experianced in VB in the slightest. Thanks
-
Oct 6th, 2003, 07:28 PM
#2
Fanatic Member
VB Code:
' Find last real column that contains a value.
intLastCol = ActiveSheet.Cells.Find(What:="*", _
LookIn:=xlValues, _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column
' Select next column.
Columns(intLastCol + 1).Select
Change the value of LookIn to xlFormulas if you want to find the last column with a formula.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|