Macro questions

T

Tim

As someone who has never written macros from scratch before, I think i
do what most people do: start a recording, do what I want to do, stop
the recording, and then fudge the recorded macro to fit my needs.

Having done that, I have a formatting problem that I can't explain.
I'm copying data in rows from Sheet1 to columns in Sheet2 with three
empty columns in between. So I'm doing something like: Sheet1!$A$1 ->
Sheet2!$A$1; Sheet1$A$2 -> Sheet2!$E$1, etc. Then I need to merge
cells Sheet2!$A$1:$D$1, etc., for all of the data I copied. Then I
have to rotate the text 90 degreed. Everything is working as I need
it to except that I can't seem to get the Autofit to work. The merged
cells with the rotated text is slightly larger ( row height ) than the
other cells, but I still can't see all of the text unless I manually
change the size of the cells. I've tried to use Autofit manually, but
it doesn't seem to work, either.

Also in Sheet2, I'm trying to add some text that has a Alt-Enter
character in the string so that the text is split across two lines.
When I recorded the macro, it put in a CHR(10) as the Alt-Enter
character. When the macro runs, I see a character in that place, but
the text is still in one line. If I double click in the cell, I see
the split text, but when I click in a different cell, all I see is the
first line. I tried to use the Autofit both in the macro and
manually, but it doesn't change the row height no matter if I select
that cell or the whole row.

I'm using Excel2007, and would also like to do some conditional
formatting with icon sets. I was able to fudge some code in the macro
to apply conditional formatting over a range of cells using the three
stoplights icon set, and display only the icon not the value. But
what I really need to do is only allow one of three values in those
cells, and then only show the Green, Yellow, or Red stoplight
depending on which of the three values was entered. If something
other than one of those three values is entered, I need to pop up an
error indicating which values are valid.

Any help would be much appreciated.

Thanks,
Tim
 

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