![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Georgia USA
Posts: 544
|
I have this Marco below, how do I make sure the active cell is in column D before the Marco runs, I don't need a row number just need to be sure it is in column D, if not in column D I need to exit the sub and do nothing. Thanks for your help, PS what's your opinion on the new board? I think it will be better in the long run.
Sub not_building_number() Application.ScreenUpdating = False ActiveCell.Offset(0, 3).Select Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False ActiveCell.Offset(0, -5).Select Selection.FillRight ActiveCell.Offset(0, 2).Select Application.ScreenUpdating = True End Sub |
|
|
|
|
|
#2 |
|
New Member
Join Date: Feb 2002
Location: Birmingham
Posts: 13
|
Put
If Not ActiveCell.Column=4 Then Exit Sub end if at the start of your macro. |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Georgia USA
Posts: 544
|
Thanks Gary worked great!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|