Apply format to whole column depending on row 1 contents
This is what I want the script to do, but how do I write it?
' ===============================
Look through ActiveSheet.UsedRange
if <the first cell in column contains (text1, text2 or text3)
whole column
width: auto
top cell only in column
text direction: horizontal
text align: h-left, v-bottom
rest of cells in column
text direction: horizontal
text align: h-left, v-middle
if <the first cell in column contains anything else
whole column
width: 4
top cell only in column
text direction: vertical
text align: h-center, v-bottom
rest of cells in column
text direction: horizontal
text align: h-right, v-middle
move to next column and repeat until reached the end of
ActiveSheet.UsedRange
' <===============================
Hope this is clear!
Kind Regards,
Samuel Harmer
|