PDA

View Full Version : Making cell font bold



username123
11-21-2008, 12:03 PM
ThisWorkbook.Sheets(2).Cells(9, k) = RS_headers(j)
ThisWorkbook.Sheets(2).Cells(9, k).Font.Bold = True

whats wrong here...i get an error on the line where i try to make the cell bold.

THANKS

GRACIAS

username123
11-21-2008, 12:20 PM
bump :hi:

georgiboy
11-21-2008, 12:34 PM
Nothing as far as i can see, it all depends what "k" is. Because if its zero or less then this could cause an error

username123
11-21-2008, 12:47 PM
if i comment out the second line the code runs fine, i just want to bold the header, and i cant see anything wrong with it.

same with the code below, its commented cuz it wont work :), i want to sort but i get an error


'Workbooks(RS_name).Sheets(1).Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
' OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

georgiboy
11-21-2008, 12:53 PM
Looks to me like it needs a range after the "Sheets(1)" part like "Sheets(1).Range("A:C").Sort"

if you could post a sample workbook this would help us in our effort to help you.

Hope this helps