+ Reply to Thread
Results 1 to 2 of 2

Help w/ .Range(passing searched cells) I can't do it

  1. #1
    Registered User
    Join Date
    05-08-2006
    Posts
    6

    Unhappy Help w/ .Range(passing searched cells) I can't do it

    Hello All.. I am trying to automate my excel to run my usual charts(4 of them). I am searching for particular information in a large file & I want to graph the ones that I want. So i have programmed the searching & cell finding but I cannot pass those addresses(cells ie: A1 to B50 to graph)
    Set F_cell = Cells.Find(what:="@sham_x") 'find first occurance
    Set L_cell = Cells.FindPrevious(after:=ActiveCell) ' find last

    Fst = F_cell.Address([ReferenceStyle:=xlA1]) 'F1 = $A$1
    Lst = L_cell.Address([ReferenceStyle:=xlA1]) 'F2 = $A$50
    Charts.Add
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("Fst:Lst"), PlotBy:=xlColumns

    I have to search at least 5 other catogories and graph them. I lack of experience and reference books. All help would be greatly appreciated.

    Thanks

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    osman

    You have included your variable names within "" This causes Excel to see them as a continuos string

    try

    ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(Fst & ":" & Lst), PlotBy:=xlColumns

+ 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