Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

FORMATING COLUMN

0

4This is so simple I hate to ask

I have data in col c  in sheet3 and 6 r0ws of data.

the msgbos shows that lrow = 6

I get compile error and syntax error on the last line   

Thanks for the help  Carroll

Private Sub CommandButton5_Click()
Dim LROW As Long
Worksheets("SHEET3").Select
 LROW = Range("C2").End(xlDown).Row
 MsgBox "LROW =" & LROW
   Worksheets("SHEET3").Range("C2:C" & lrow) .VerticalAlignment = xlCenter
End Sub
Answer
Discuss

Answers

0
Selected Answer

Double check the spacing in front of     .VerticalAlignment.  It appears to have a space.  Remove the space and try it  (

Worksheets("Sheet3").Range("C2:C" & LROW).VerticalAlignment = xlCenter
)
Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login