LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Pulling cell value into macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling out comments with macro dwake Excel Discussion (Misc queries) 5 November 25th 09 05:41 PM
Pulling data from one cell to another Ivan Koh[_2_] Excel Discussion (Misc queries) 3 May 4th 09 06:53 PM
Macro pulling data from 2 worksheets billrl34 Excel Discussion (Misc queries) 2 December 12th 05 08:50 PM
Pulling a Letter from a cell and filling another cell with info nick s Excel Worksheet Functions 16 November 28th 05 04:10 AM
pulling certain data out of a cell D richardson Excel Worksheet Functions 6 May 13th 05 06:10 PM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"