View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] kudruu@gmail.com is offline
external usenet poster
 
Posts: 10
Default Selecting Separate Columns in VBA

Hi,
I have been having a significant amount of difficulty in VBA trying to
select multiple rows for graphing. I am inputing the spreadsheet data
as output from a file (from which the inputs are also in another sheet)
and I need to graph some of the rows and columns. The rows are not
always together nor does the output always form the same number of rows
each time. For instance in some cases I want to graph from the range
B70 to B85 and sometimes from B70 to B74 depending on what the program
outputs. Aside from these I also need another column to be selected to
graph along the X and Y axes - so I need to select columns B70 and E70
to B85 and E85. I've tried using the offset function but Excel doesn't
seem to like it when I try to run a command like
Range("B70:B85").Select and Range("E70:E85"). Although I realize this
syntax does not make sense is there a way to select multiple columns
like this through a loop which searches for a delimiter so that the
range can be flexible each time? This would be particularly essential
since the program outputs several places for data on the same
spreadsheet and I would need to run this graphing function multiple
times for each iteration.
What sort of commands are useful for looping through a command like
Range.Select adding on to the selection each time through use of a Do
Until or For loop?
Thanks in advance for any help!

Andrew