Hi Every One, i have a VBA code that writes Quantum Data base from Excel Workbook, This Workbook contains TAGs Names, TAGs Values and TimeShift data, so one of the sheets contain the same variables But it is requested from me to use non fixed time shifts so they will enter the date they wanted to be stored as written in the database, any way i am using Case Selection to pick date from certain cells like below code:

i really appreciate suggestions on my code, thanks a lot




Select Case TIMEINDEX
Case 1
    TagTime = Range("C45").Value                     ' TimeShifts are {4:00,8:00,12:00,16:00}
    Timestamp = CDate(TagDate & " " & TagTime)
Case 2
    TagTime = Range("C46").Value
    Timestamp = CDate(TagDate & " " & TagTime)
Case 3
    TagTime = Range("C47").Value
    Timestamp = CDate(TagDate & " " & TagTime)
Case 4  
                                                              '  here i would like to add Range("B11:B129") as a variable references for manual entred time shifts
 Lastrow = Range("B129").Value
    For j = 1 To Lastrow
                                                                         
Sheets("Choke Size").Range("B11").Offset(j, 0)
TagTime = CStr(i)
Next  j
I don't know how to automate Offset every time that the code request TIMEINDEX selection so it would take shifted time by 1 row Offset(1,0)
by the way i am using For i = Startrow to Endrow to read TAGs values and time shifts row by row.