Macro help - changing values in 1 cell on different rows

  • Thread starter Thread starter Carsten Bauer
  • Start date Start date
C

Carsten Bauer

Hi all

I've got this spreadsheet:
A B C D
E
1 Flight To DepartingBoarding
Status
2 NC714 GRANITES 04:00 03:45 Check In
3 NC760 MURRIN MURRIN 15:15 15:00 Boarding
4 NC700 GOLDEN GROVE 16:00 15:45 Delayed
5 NC704 BARIMUNYA 15:00 14:45 Closed

Hope that looks ok...
Anyway, if the cell selected is on line 3 for example, i want to be
able to make a macro that changes the value of E3 to "Delayed" or
"Closed" etc etc....
Then when i'm on line 5, do the same thing for cell E5
I recored a macro, but it only ever changed the same cell, that i
changed when i recorded the macro :-(
 
one way:

Public Sub Delayed()
Cells(ActiveCell.Row, 5).Value = "Delayed"
End Sub

Public Sub Boarding()
Cells(ActiveCell.Row, 5).Value = "Boarding"
End Sub

Public Sub Closed()
Cells(ActiveCell.Row, 5).Value = "Closed"
End Sub
 
one way:

Public Sub Delayed()
Cells(ActiveCell.Row, 5).Value = "Delayed"
End Sub

Public Sub Boarding()
Cells(ActiveCell.Row, 5).Value = "Boarding"
End Sub

Public Sub Closed()
Cells(ActiveCell.Row, 5).Value = "Closed"
End Sub

Oh thank you soo much. That's exactly what I needed.
You ppl are legends :-)
 
Back
Top