Shantaram_c
New Member
- Joined
- Nov 6, 2003
- Messages
- 20
How can i create xla for follwoing code
Sub sd()
Workbooks("A&M CONS-TMR-NOV04.xls").Worksheets("CONS-TMR-NOV04").Activate
max_row = 7
v_continue = True
Do While v_continue = True
cell_name = "j" & max_row
'MsgBox (cellname)
Range(cell_name).Select
If Len(Trim(ActiveCell)) = 0 Then
v_continue = False
Else
max_row = max_row + 1
End If
Loop
Workbooks("980.xls").Worksheets("sheet1").Activate
tmax_row = 9
v_continue = True
Do While v_continue = True
cell_name = "d" & tmax_row
'MsgBox (cellname)
Range(cell_name).Select
If Len(Trim(ActiveCell)) = 0 Then
v_continue = False
Else
tmax_row = tmax_row + 1
End If
Loop
Dim t, i
For i = 10 To tmax_row
Workbooks("980.xls").Worksheets("sheet1").Activate
cell_name = "e" & i
celselect = Left(Range(cell_name).Value, 20)
For t = 7 To max_row
Workbooks("A&M CONS-TMR-NOV04.xls").Worksheets("CONS-TMR-NOV04").Activate
cell_name = "b" & t
Range(cell_name).Select
If Range(cell_name).Value = celselect Then
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3
cell_name = "A" & t
Range(cell_name).Value = 1
End If
Next t
Next i
End Sub
Sub sd()
Workbooks("A&M CONS-TMR-NOV04.xls").Worksheets("CONS-TMR-NOV04").Activate
max_row = 7
v_continue = True
Do While v_continue = True
cell_name = "j" & max_row
'MsgBox (cellname)
Range(cell_name).Select
If Len(Trim(ActiveCell)) = 0 Then
v_continue = False
Else
max_row = max_row + 1
End If
Loop
Workbooks("980.xls").Worksheets("sheet1").Activate
tmax_row = 9
v_continue = True
Do While v_continue = True
cell_name = "d" & tmax_row
'MsgBox (cellname)
Range(cell_name).Select
If Len(Trim(ActiveCell)) = 0 Then
v_continue = False
Else
tmax_row = tmax_row + 1
End If
Loop
Dim t, i
For i = 10 To tmax_row
Workbooks("980.xls").Worksheets("sheet1").Activate
cell_name = "e" & i
celselect = Left(Range(cell_name).Value, 20)
For t = 7 To max_row
Workbooks("A&M CONS-TMR-NOV04.xls").Worksheets("CONS-TMR-NOV04").Activate
cell_name = "b" & t
Range(cell_name).Select
If Range(cell_name).Value = celselect Then
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3
cell_name = "A" & t
Range(cell_name).Value = 1
End If
Next t
Next i
End Sub