I have excel 2007
I'm just learning macros. Here's the setup.
sheet 1 is for getting the miles from city a to city b
i.e. a1 I input city a. a2 I input City b the on b2 it will tell me what the mileage is.
Sheet 2 has my mileage chart where all the mileage info is stored from city to city
It's pretty much set up like every other mileage chart you see on a map with the city name across the top row and the same name on the left column
then the mileage is set in the grid
every once in a while I will input a city name into sheet 1 and I haven't yet input that number into sheet 2 yet so 0 is displayed
I have added 3 cells in sheet 1 to automatically enter the correct mileage into the mileage chart
the 1st cell I input city a
the 2nd cell city b and the 3rd cell the mileage
the next thing I have are 3 cells in sheet 2
the 1st cell (lets call it A1) tells me the r#c# of the intersection of the 2 cities
the 2nd one (A2) tells me the opposite r#c# since each mileage is listed twice depending on whether its from city 1 to city 2 or city 2 to city 1
the 3rd (A3) is the mileage that I input in sheet 1
now what ive been doing is just copying the R#c# from A1 and pasting it into the name box and hitting enter. It then brings me to that location
and then I type in the mileage
then copy and paste the 2nd address located in A2 into the name box and entering the miles again.
what I want is a macro so all I have to do after entering the 2 city names and mileage into sheet 1
is run the macro and have it automatically go to the addresses specified in sheet 2 and input the mileage in for me
every time I try this the macro does not record me pasting the R#C# from A1 and A2 into the name box and hitting enter.
It just inputs the mileage into the same boxes every time. Since the address is going to be different every time this just wont work.
So how to make a macro that goes to a certain address located in a separate cells (A1and A2) and inputs information into those cells thats located in a separate cell (A3)
Bookmarks