Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1422|回复: 1

求助4列时间数据赋值给变量tim

[复制链接]
发表于 2016-7-30 21:12 | 显示全部楼层 |阅读模式
Private Sub CommandButton2_Click()
    Dim ir&, k&, arr, dic, a%, brr(), m%, n%
    Dim i_id%, i_name%, i_date%, i_time1%, i_time2%, i_time3%, i_time4%
    Dim dat1 As Date, dat2 As Date, il%, tim As Date, kao$
    i_id = InStr("ABCDEFGH", ComboBox2.Value)    i_date = InStr("ABCDEFGH", ComboBox3.Value)
    i_time1 = InStr("ABCDEFGH", ComboBox4.Value)
    i_time2 = InStr("ABCDEFGH", ComboBox5.Value)
    i_time3 = InStr("ABCDEFGH", ComboBox6.Value)
    i_time4 = InStr("ABCDEFGH", ComboBox7.Value)
    For k = 1 To UBound(arr, 1)    m = dic.Item(arr(k, i_id)) + 1   
    n = (arr(k, i_date) - dat1) * 2
    tim = Format(arr(k, i_time1), "hh:mm") & Format(arr(k, i_time2), "hh:mm") & Format(arr(k, i_time3), "hh:mm") & Format(arr(k, i_time4), "hh:mm")
老师请教个问题,上面代码到tim=这里出错,我需要怎样才能把4列的数据都赋值给tim呢?
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2016-7-31 20:33 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2025-8-15 21:52 , Processed in 0.408171 second(s), 9 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表