Generalized Macro

G

Guest

Hello,
I am very new to programming, I am a scientist by education.I have 2
questions:

1) I am trying to write a macro to do a simple calculation and make a graph
from two column of data. I have successfully recorded a macro for one set of
data. I need to repeat this process amny times. There will be many text files
that will contain the same columns, I want to macro to work on each, no
matter how long the columns are. I am trying to figure out how to generalize
the range variable so that someone can press a button after opening the text
file and get the graph in question.

2) I am also trying to find a way to easily import these text files into
Excel. If I right-click and open with...Excel, they open perfectly for what I
am trying to do, but if I open from inside Excel, I have to go through the
whole import menu. Can I create a form for importing that would open from a
button a menu for choosing the file and then open the file without the whole
import wizard?

Thank you for any advice,
Rebecca
 
P

PY & Associates

1, outside loop each file
inside loop each cell in column of your choice
do your stuff
next cell
next file

2, record a macro
put it in a loop also
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top