Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Criptic VB Code
Below I am attempting to write some VB code and I now get an error with the
second level of the statement "For Each cell in Range" can I not have multiple levels of this command like I can with the "IF" statement. I really hate the OJT factor so any help with improving the code below would also be GREATLY appreciated. Thanks, El Bee ************ For Each cell In Range(rng_3, rng_4) If cell.Value = ProgName Then If InStr(levels, cell.Offset(0, 1).Select) Then Selection.End(xlToLeft).Select ' get the logon name for search in Ecometry Data wrksheet logon = ActiveCell.Value Sheets("Ecometry Data").Select For Each cell In Range(rng_1, rng_2) If cell.Value = logon Then Range(Selection, Selection.End(xlToRight)).Select Application.CutCopyMode = False Selection.Copy Copy_from = ActiveCell.Address Sheets("Profiles").Activate Range(paste_here).Select Selection.PasteSpecial Paste:=xlPasteAll, operation:=xlNone, _ skipblanks:=False, Transpose:=True cell.Offset(2, 13).Select Range(Copy_from).Select Selection.End(xlToRight).Select Selection.End(xlToRight).Select Application.CutCopyMode = False Selection.Copy Sheets("Profiles").Select Selection.PasteSpecial Paste:=xlPasteAll, operation:=xlNone, skipblanks:= _ False, Transpose:=True Application.CutCopyMode = False Range(past_here).Select cell.Offset(0, 3).Select paste_here = ActiveCell.Address End If Next cell End If End If Next cell |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Unprotect Code Module in Code | Excel Discussion (Misc queries) | |||
Need 2 add second then third code with first code in the Tab View | Excel Worksheet Functions | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) |