How to replace existing information, with same questions

时间:2019-06-01 14:06:56

标签: excel vba macros

i have the questions to add a new row, but need a way to edit existing rows with the user being asked which time (kerta) and filling out the same questions to replace old info

Dim Päivä As String
Dim Kerta As String
Dim lastrow1 As Long
Dim lastrow4 As Long

Päivä = InputBox("Mikä päivä?", "PÄIVÄKIRJA")
lastrow1 = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row + 1
ActiveSheet.Cells(lastrow1, "B").Value = Päivä

Kerta = InputBox("Monesko harjoituskerta", "PÄIVÄKIRJA")
lastrow4 = ActiveSheet.Cells(Rows.Count, "F").End(xlUp).Row
ActiveSheet.Cells(lastrow4, "F").Value = Kerta

i have a question which asks the number of the session, and i need to recognize the row based on this cell's value, and replace the row with the questions. (päivä = day / kerta = session)

0 个答案:

没有答案