Number and names of courses may change later
I'm using Excel 2010 and I have three company course names that I must add to a spreadsheet and I must do this operation routinely. I want the operation to move to the right in the spreadsheet and find the first available and empty column and then enter the course name, move right, enter another course name, etc. Here is the code that I'm using and it does work.
Code:
|
Number and names of courses may change later
|
Number and names of courses may change later
Hi John,
I forgot font.bold and autofit: Sub Test() Dim i As Integer Dim FECol As Long Dim NamesArr As Variant NamesArr = Array("Social Styles", "Adaptive Leadership", _ "Leading Virtually") FECol = Cells(1, Columns.Count).End(xlToLeft).Column + 1 For i = 0 To UBound(NamesArr) With Cells(1, FECol + i) .Value = NamesArr(i) .Font.Bold = True .EntireColumn.AutoFit End With Next End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
Number and names of courses may change later
Your code worked flawlessly and helped me understand how to do it. Thank you very much.
|
All times are GMT +1. The time now is 04:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com