Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having trouble pulling a value in a cell into a macro for calculations
The macro is below. The is executed when ENTER is clicked on userform. It is suppose to pull a date in from the spreadsheet (B125:B176) and evaluate it against date entered in userform. Private Sub CommandButton1_Click() Dim i As Double Dim date1 As Date Dim ttltime1, ttltime2 As Double ttltime1 = Val(TextBox2) - Val(TextBox1) ttltime2 = Hour(ttltime1) + (Minute(ttltime1) / 60) With Worksheets("PAS") For i = 125 To 176 date1 = .Cell(i, 2).Value <<< Problem code If TextBox1 <= date1 Then .Cell(i, (TextBox1 - date1) + 3).Value = ttltime2 i = 176 End If Next End With End Sub Thanks, Les |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling out comments with macro | Excel Discussion (Misc queries) | |||
Pulling data from one cell to another | Excel Discussion (Misc queries) | |||
Macro pulling data from 2 worksheets | Excel Discussion (Misc queries) | |||
Pulling a Letter from a cell and filling another cell with info | Excel Worksheet Functions | |||
pulling certain data out of a cell | Excel Worksheet Functions |