Results 1 to 5 of 5

macro loop through worksheets

Threaded View

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    Singa[pre
    MS-Off Ver
    Excel 2003
    Posts
    49

    macro loop through worksheets

    After applying macro on Sheet1,go to Sheet2 and to apply the same macro, plse add code
    Dim lastrow As Long
    Dim selectnum As Long
    lastrow = Cells(Rows.Count, "a").End(xlUp).Row
    Select Case True
    Case lastrow > 30:  selectnum = 30
    Case lastrow > 20: selectnum = 20
    Case lastrow > 10:   selectnum = lastrow
    End Select
    Cells(lastrow - selectnum + 1, "a").Resize(selectnum, 3).Select
    
    Set cht1 = ActiveSheet.Shapes.AddChart
        cht1.Chart.ChartType = xlLineMarkers
        cht1.Chart.Location xlLocationAsNewSheet
    ActiveChart.ChartArea.Select
        ActiveChart.PlotArea.Select
    Attached Files Attached Files

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