Excel/Excel Macro Doesn't Workd
This request for help may be redundant. I may have taken too long to write it and ultimately got a message that I had timed out. Sorry.
- - - - - - - - - - - - - - - - - - - -
You've solved my problems in the past perfectly, so here I am again. I am using Excel 2010.
I have two problems, I suspect both interrelated. A financial company with whom I deal can export, in Excel format, a particular report which has the data I want. The file I can download is named “Export.xls”, (note the filename extension), and when I try to open it in Excel 2010, I get a message that says: The file you are trying to open, “Export.xls” is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? It offers three options: Yes, No, Help.
I click on Yes and open the file. I am able to manipulate the data manually without difficulty. I write some macro code for this spreadsheet and “save as” with the filename extension “.xlsm”.
In the macro I’ve written. Cell ("A2") is already selected when I open the file, which makes it my activecell and has a black border around the cell. I process some activity with the value in cell A2. Now I want to go to a different cell, specifically "C3". In the macro I include the following line of macro code:
ActiveCell = ActiveCell.Offset(1,2)
to make it the activecell. BUT the black border does not move from cell A2 to cell C3 and C3 does not become the activecell. If I manually click on C3, it immediately captures the black border and is the activecell.
I've checked "protection" for the worksheet and have unchecked both "Locked" and "Hidden". That resulted in no change as far as activecell is concerned.
1. Why do I have a problem opening the file “Export.xls” and what should I do to make it a viable file in Excel 2010? What filename extension should I use?
2. Why does my macro code not move the activecell with the macro code shown above?
Any guidance you can give me would be most appreciated. Thank you.
1 - no idea. should open fine. But you might as well ignore that message since it opens OK.
2 - the statement ActiveCell = ActiveCell.Offset(1,2) simply assigns the VALUE of C3 to the active cell; it doesn't move it. To move it, there are lots of ways, the easiest being Range("C3").Select. But you can also use Activecell.Offset(1,2).Select