+ Reply to Thread
Results 1 to 5 of 5

For Next + Range("A2:G2") + Call mysub

  1. #1
    Registered User
    Join Date
    04-09-2012
    Location
    Italy
    MS-Off Ver
    2021 Pro
    Posts
    52

    For Next + Range("A2:G2") + Call mysub

    Hell all users !! I am a new user so i salute everyone. This forum seems full like the old MS forum..!!

    i have a little question , probably easy..
    i make this and it works fine....

    Dim aWB As Workbook
    Dim aWS As Worksheet
    Dim i As Long
    Set aWB = ThisWorkbook
    Set aWS = aWB.Worksheets("Main")
    For i = 4 To 80 Step 4
    aWS.Range("D" & i).Value = (aWS.Range("H7").Value - aWS.Range("C" & i).Value) / aWS.Range("O4").Value
    aWS.Range("B" & i).Value = (aWS.Range("G7").Value - aWS.Range("A" & i).Value) / aWS.Range("O4").Value
    Next


    but...what if i would like to indicate a range...like this (syntax not working!) .....aWS.Range("A" & i : "H" & i).CalculateRowMajorOrder ???
    and if i want to call a sub inside the For Next .. would it be possible to propagate the > i < to the called sub ???

    Thanks who can help !! Please if anybody knows if excel-dna can multithread a for next ..tx !
    Paolo
    Last edited by ZuluNation; 04-09-2012 at 01:00 PM.

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: For Next + Range("A2:G2") + Call mysub

    Try include the colon in the quotes.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-09-2012
    Location
    Italy
    MS-Off Ver
    2021 Pro
    Posts
    52

    Re: For Next + Range("A2:G2") + Call mysub

    tx ..the i becomes white !! anything about the other problem ??

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: For Next + Range("A2:G2") + Call mysub

    Possibly something along the lines of...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-09-2012
    Location
    Italy
    MS-Off Ver
    2021 Pro
    Posts
    52

    Re: For Next + Range("A2:G2") + Call mysub

    Perfect ! ..couldn't work without this..

    Option Explicit
    Public i As Long

    Ty dangelor !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1