Convert Range to Activesheet.Cells

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • if1467
    New Member
    • Feb 2008
    • 25

    Convert Range to Activesheet.Cells

    Is there a way that I can convert

    Code:
    Range("A1:C1,A3:C6,A8:C11").Select
    to the activesheets.ce lls format.

    I am trying to select multiple cells with variable references.

    Thanks
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by if1467
    Is there a way that I can convert

    Code:
    Range("A1:C1,A3:C6,A8:C11").Select
    to the activesheets.ce lls format.

    I am trying to select multiple cells with variable references.

    Thanks
    sure, just dont select the range so quickly
    do something like

    [CODE=vb]Worksheets("des tination").rang e("a1:c1").fo nt = activesheets.ce lls.font[/CODE]

    and the same for every "format" you wish to copy

    Comment

    • if1467
      New Member
      • Feb 2008
      • 25

      #3
      Let me try to rephrase this. I am trying to do a Selection.Find on a range of cells.

      Example:
      Code:
      Range("B6:B8").Select
      Selection.Find(What:=dateref, LookIn:=xlValues, LookAt _
              :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
              False, SearchFormat:=False).Activate
      My problem is that I need to have the range that I search be variable. I only know how to use ActiveSheet.Cel ls(rownum, colnum) to select a single cell. Is there a way to do this for multiple cells?

      Comment

      • kadghar
        Recognized Expert Top Contributor
        • Apr 2007
        • 1302

        #4
        Originally posted by if1467
        Let me try to rephrase this. I am trying to do a Selection.Find on a range of cells.

        Example:
        Code:
        Range("B6:B8").Select
        Selection.Find(What:=dateref, LookIn:=xlValues, LookAt _
                :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
                False, SearchFormat:=False).Activate
        My problem is that I need to have the range that I search be variable. I only know how to use ActiveSheet.Cel ls(rownum, colnum) to select a single cell. Is there a way to do this for multiple cells?
        oops, sorry

        there's one way to use Range with cells:

        Range(cells(1,1 ),cells(5,5)) will select the first 25 cells ^.^

        Comment

        Working...