Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Need help with Visual Script Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sharad kumar - 10 Nov 2007 10:58 GMT
Hi, someone please provide me the code for following column in excel.
Like I have a column a and column b. In column a, I have time and in
column b, I have time in 0:30 minutes interval. So consolidating column
a into column b with half an hour difference. I want a macro or script
where data in colum B automatically comes with time distances and in the
same parameter with same slot (30 minutes)

a    b
0:07    0:00
0:08    0:00
0:10    0:00
0:13    0:00
0:14    0:00
0:18    0:00
0:21    0:00
0:25    0:00
0:27    0:00
0:29    0:00
0:41    0:30
0:42    0:30
0:50    0:30
1:14    1:00
1:16    1:00
1:22    1:00
1:28    1:00
1:29    1:00
1:58    1:30
2:01    2:00

Please help me.
Bob Phillips - 10 Nov 2007 11:48 GMT
Sub Clearout()
Dim LastRow As Long
Dim i As Long

   LastRow = Range("A" & Rows.Count).End(xlUp).Row
   For i = 1 To LastRow
       Cells(i, "B").Value = Int(Cells(i, "A").Value * 48) / 48
   Next i
   Columns(2).NumberFormat = "hh:mm"
End Sub

Signature

HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Hi, someone please provide me the code for following column in excel.
> Like I have a column a and column b. In column a, I have time and in
[quoted text clipped - 28 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.