Consulting

Results 1 to 2 of 2

Thread: For in columns Range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2015
    Posts
    7
    Location

    For in columns Range

    Hi everyone, im learning the basic of VBA and i can figure out how to advance in cell range.
    What i need in my Macro is: From a Worksheet (ex: W1) select a whole cell, and the result paste it in another worksheet (W2) cell (A1), then pick another column of W1 and sum it and paste it in A2 and so on.
    What i've wrote is

    Sub SumasTbf()
    Dim Seleccion As Range
    Dim Suma
    
    
    Worksheets("hoja2").Activate
    Set Seleccion = Range(ActiveSheet.Range("B1"), ActiveSheet.Range("B1").End(xlDown))
    Suma = WorksheetFunction.Sum(Seleccion)
    Worksheets("hoja3").Range("F1") = Suma
    End Sub
    Now im thinking in using a FOR to move the range B1 to C1 but i dont know how to move the B to C, can you help me plz! in case of working with rows it would be "B"& x ?? (another question)... waiting for an answer
    Last edited by tomzko; 12-30-2015 at 03:18 PM.

Posting Permissions

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