E
El Bee
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
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