Results 1 to 5 of 5

Thread: [RESOLVED] How to loop all used cells certain column in a sheet vb.

Threaded View

  1. #1

    Thread Starter
    Lively Member elmnas's Avatar
    Join Date
    Jul 2009
    Posts
    127

    Resolved [RESOLVED] How to loop all used cells certain column in a sheet vb.

    hello people,

    I have got following code so far.

    I wonder how I make my VBA loop into VB.


    here is my VB CODE
    Code:
            Dim xlApp As Excel.Application
            Dim xlSht As Excel.Worksheet
            Dim xlRng As Excel.Range
            xlApp = New Excel.Application
    
            xlApp.DisplayAlerts = False
            xlApp.Workbooks.Open(C:\test.xls)
            xlSht = xlApp.Sheets(1)
            xlRng = xlSht.Cells(1, 1) ' here is just some sample code to get any result
            MsgBox(xlRng.Value) ' just a msgbox to alert cell content (1,1)
    here is my vba loop I need to convert to vb
    Code:
      For i = 1 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).row
           Cells(i, "A").Value
        Next i
    Could someone help me?

    Thank you in advance
    Last edited by elmnas; Dec 2nd, 2015 at 08:49 AM.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width