blntfrctrma
07-30-2009, 09:24 AM
hello to all,
i am new to vba, and when i mean new i mean i had no idea anything like it existed until now. im currently taking the "fast track" learning program to write some basic code and im having problems picking up what im doing wrong. if someone can point out what im doing wrong it would be much appriciated. this is the code that im using at the moment.
Private Sub donkey()
Worksheets("sheet1").Select
Range("e9").Select
If Worksheets("sheet1").Range("f10").Value = "1" Then
Worksheets("sheet1").Range("e9").Value = "Line 1"
Worksheets("sheet1").Range("e9").Font.Size = "16"
Worksheets("sheet1").Range("e9").Font.Bold = True
ElseIf Worksheets("sheet1").Column("f") <> "1" Then
InsertRow.Offset(-1, 0).Select
Range("E").Offset(-1, 0).Select
Worksheets("sheet1").Column("e").Value = "Line 3"
Worksheets("sheet1").Range("e").Font.Size = "16"
Worksheets("sheet1").Range("e").Font.Bold = True
End If
End Sub
what i want this code to do is to categorize the lines(there are 30 total). now being new im not up on the vocabulary i need to properly explain so ill do my best. column "f" is organized in ascending order(the lines numbers are all over the map). column "e" is the type of work that needs to be done. i want to be able to separate where the lines start and end with the appropriate line number using column "F" to decide where to insert the separation. on top of that in the inserted row i want the line number's title to appear. i hope i explained this enough for someone to give me a bit of insight thank you kindly for any assistance.
i am new to vba, and when i mean new i mean i had no idea anything like it existed until now. im currently taking the "fast track" learning program to write some basic code and im having problems picking up what im doing wrong. if someone can point out what im doing wrong it would be much appriciated. this is the code that im using at the moment.
Private Sub donkey()
Worksheets("sheet1").Select
Range("e9").Select
If Worksheets("sheet1").Range("f10").Value = "1" Then
Worksheets("sheet1").Range("e9").Value = "Line 1"
Worksheets("sheet1").Range("e9").Font.Size = "16"
Worksheets("sheet1").Range("e9").Font.Bold = True
ElseIf Worksheets("sheet1").Column("f") <> "1" Then
InsertRow.Offset(-1, 0).Select
Range("E").Offset(-1, 0).Select
Worksheets("sheet1").Column("e").Value = "Line 3"
Worksheets("sheet1").Range("e").Font.Size = "16"
Worksheets("sheet1").Range("e").Font.Bold = True
End If
End Sub
what i want this code to do is to categorize the lines(there are 30 total). now being new im not up on the vocabulary i need to properly explain so ill do my best. column "f" is organized in ascending order(the lines numbers are all over the map). column "e" is the type of work that needs to be done. i want to be able to separate where the lines start and end with the appropriate line number using column "F" to decide where to insert the separation. on top of that in the inserted row i want the line number's title to appear. i hope i explained this enough for someone to give me a bit of insight thank you kindly for any assistance.