Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Loretta Carpenter   on Oct 31 In MS Office Category.

  
Question Answered By: Mildred Bailey   on Oct 31

Double check 'where' is the 'Active' column:
If it is respect to the LastCell, the code  returns the 2nd to the last column
in the data  set.
If the intent is upon an active cell  in column  'D', & you are looking to
select column 'C' in the code, we need to make a slight adjustment to grab the
active column 'before' moving to the 'LastCell':

Sub SelectColumn( )
Dim iRow as Integer
Dim iCol as Integer

iCol = ActiveCell.Column

ActiveCell.SpecialC ells(xlLastCell) .Select
iRow = ActiveCell.Row
Range(Cells( 1,iCol - 1),Cells(iRow, iCol - 1)).Select
End Sub

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on keypress shortcuts Or get search suggestion and latest updates.


Tagged: