Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Convert a Number Code to a Text Code Traye Excel Discussion (Misc queries) 3 April 6th 07 09:54 PM
Unprotect Code Module in Code Damien Excel Discussion (Misc queries) 2 April 18th 06 03:10 PM
Need 2 add second then third code with first code in the Tab View nick s Excel Worksheet Functions 3 December 6th 05 02:20 AM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"