|
|
|
|
| ****************************************
| | 2018/12/18 | 《asp,简易记事本修改》 |
|
asp,简易记事本, 目的:改变事态后,显示未处理 原: Response.write"<script>alert('事件状态修改成功。');location.href='txt.asp'</script>" 修改为: Response.write"<script>alert('事件状态修改成功。');location.href='txt.asp?list=false'</script>"
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/18 | 《数据库按顺序显示》 |
|
asp 将Access数据库某列的内容按顺序的显示在某张网页上 order by id desc 为降序 order by id asc 为升序 id为数据库排列,可以任意(如data) 列:<降序> 在20日记中: sql="select * from [day] order by id DESC" 在40简易记事本中:<原为:.........order by id"> sql="select * from jishi order by id desc" elseif request("list")="true" then sql="select * from jishi where ok=true order by id desc" elseif request("list")="false" then sql="select * from jishi where ok=false order by id desc"
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/8 | 《vba中单元格位置对齐技巧》 |
|
Sub 单元格对齐技巧() Dim myRange As Range Set myRange = Range("A1") '指定任意单元格Cells(ii, j) 替换变量 With myRange .Value = "ExcelVBA实用技巧大全" "复制代码时,不要MsgBox .HorizontalAlignment = xlRight MsgBox "水平右对齐。" .HorizontalAlignment = xlLeft MsgBox "水平左对齐。" .HorizontalAlignment = xlCenter MsgBox "水平居中。" .HorizontalAlignment = xlDistributed MsgBox "水平分散对齐。" .VerticalAlignment = xlTop MsgBox "垂直靠上。" .VerticalAlignment = xlBottom MsgBox "垂直靠下。" .VerticalAlignment = xlCenter MsgBox "垂直居中。" .HorizontalAlignment = xlGeneral .VerticalAlignment = xlGeneral MsgBox "恢复默认。" End With Set myRange = Nothing End Sub
With Selection ActiveSheet.UsedRange.HorizontalAlignment = xlRight '对已用区域右对齐 End With
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/8 | 《单元格标注成红色》 |
|
vba,单元格标注成红色,(ii 和 j)为变量 单元格底色设置为红色(填充) Cells(ii, j).Interior.Color = vbRed
VBA,设置字体颜色(Cells 和 Range 的区别) Cells(ii, j).Font.Color = vbRed '(ii 和 j)为变量 Range("A1").Font.Color = vbRed
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/7 | 《删除空白列代码,汇总变量J列》 |
|
Sub 删除空白列代码() Application.ScreenUpdating = False For i = 1 To 50 '删除第一行“剩余课时”列 If Cells(1, i) = "剩余课时" Then Columns(i).Delete End If Next '删除“剩余课时列代码结束
Dim iC&, x& iC = Cells(1, 256).End(xlToLeft).Column For x = iC To 1 Step -1 If Cells(3, x) = "" And Cells(4, x) = "" And Cells(5, x) = "" And Cells(6, x) = "" And Cells(7, x) = "" And Cells(4, x) = "" And Cells(5, x) = "" And Cells(8, x) = "" And Cells(9, x) = "" And Cells(10, x) = "" And Cells(11, x) = "" And Cells(12, x) = "" And Cells(13, x) = "" And Cells(14, x) = "" And Cells(15, x) = "" And Cells(16, x) = "" And Cells(17, x) = "" And Cells(18, x) = "" Then Columns(x).Delete Next x For j = 1 To 40 '寻找“已上课时”列的循环 If Cells(1, j) = "已上课时" Then ii = Range("A65536").End(xlUp).Row() + 1 '定位到A列最后一行的下一行,ii For iii = 3 To Range("A65536").End(xlUp).Row() Cells(ii, j - 1) = "合计:" Cells(ii, j).Value = Application.WorksheetFunction.Sum(Range(Cells(2, j), Cells(iii, j))) '列汇总 Next End If Next Application.ScreenUpdating = True End Sub
Cells(ii, j).Value = Application.WorksheetFunction.Sum(Range(Cells(2, j), Cells(iii, j))) '列汇总 这句是汇总变量J列的代码,也要给iii赋值: For iii = 3 To Range("A65536").End(xlUp).Row()
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/5 | 《win10邮箱设置》 |
|
win10邮箱设置: 最重要的是密码不是邮箱登录密码,而是认证密码 4269259hjt
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/5 | 《学府的上网账号和密码及路由IP》 |
|
学府的上网账号和密码及路由IP
宽带上网账号和密码: 宽带账号:02982294898密码:a123456
移动路由IP:192.168.1.25 阿里路由IP:192.168.3.20
wifi密码:13609192500hjt
电信光猫: 用户登陆:useradmin 密码:nE7jA%5m IP:192.168.1.1
新安装的电信光猫:ZXHN G7615TV2-XG 中兴光猫
账号:useradmin 普通设置密码:A4269259hjt
账号:useradmin 超密:qGc#7BPuQHM9
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/3 | 《VBA变量类型缩写》 |
VBA变量类型缩写,这样记忆就太简单了! 2018-01-18 07:45 来源:Excel之家ExcelHome 原标题:VBA变量类型缩写,这样记忆就太简单了! 在VBA代码编写过程中,经常可见&@#$之类的符号,这些符号便是变量的简写…… 作为初学者来说,对此往往一头雾水,搞不懂这些简写符号所代表的变量所指…… SO,VBA变量简写如何记忆才简单快速? 1,$ = String 文本字符串 String第1个字母是 S, 所以请记住,美元s=String 【文本字符串】。 2,& = Long 整数 & 可以看做是Long首字母L的花体字 所以请记住为【长整型数值】。 3,% = Integer 整数 % 是百分比符号,我们可以把它联想为较少的整数【整型数值】。 4,! = Single 单精度小数 ! 笔画只是1竖单笔画,所以请记住为【单精度】。 5,# = Double 双精度小数 # 笔画是2横2竖,所以请记住为【双精度】 6,@ = Currency 货币型4位小数 现实中人们也常用@符号代表价格、单价,所以请记住为【货币型小数】 这样记忆是不是简单多了呢?
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/12/3 | 《vba,最后一行,写入单元格》 |
如何使用vba命令定位到最后一行有内容单元格的下一行。
i=range("A65536").end(xlup).row()+1 这个i就是A列你要的行号 此代码只适用于excel 2003 如果是07以上 65536修改为1048576
追答:不懂你的定位是什么概念。
sub aa() i=range("A65536").end(xlup).row()+1 range("A" & i).Select msgbox "你需要的是A"& i end sub
Sub 删除空白列代码() Application.ScreenUpdating = False For i = 1 To 50 '删除第一行“剩余课时”列 If Cells(1, i) = "剩余课时" Then Columns(i).Delete End If Next '删除“剩余课时列代码结束 Dim iC&, x& 'Columns("Am").Delete iC = Cells(1, 256).End(xlToLeft).Column For x = iC To 1 Step -1 'If Cells(3, x) And Cells(4, x) And Cells(5, x) And Cells(6, x) And Cells(7, x) = "" Then Columns(x).Delete If Cells(3, x) = "" And Cells(4, x) = "" And Cells(5, x) = "" Then Columns(x).Delete Next x For j = 1 To 40 '寻找“已上课时”列的循环 If Cells(1, j) = "已上课时" Then ii = Range("A65536").End(xlUp).Row() + 1 '定位到A列最后一行的下一行,ii Cells(ii, j - 1) = "合计:" End If Next '删除“剩余课时列代码结束 Application.ScreenUpdating = True End Sub
|
|
|
|
|
|
|
|
|
|
| ****************************************
| | 2018/11/30 | 《下拉菜单中,关于sheet》 |
|
vba,下拉菜单,去掉sheet后代码: Private Sub UserForm_Initialize() Dim Myr&, i& Dim brr, d, k Set d = CreateObject("Scripting.Dictionary") Myr = Range("d65536").End(xlUp).Row brr = Range("c2:c" & Myr) For i = 1 To UBound(brr) If brr(i, 1) <> "" Then '加上这一句防止中间有空值 d(brr(i, 1)) = "" End If Next k = d.keys ComboBox1.List = k Set d = Nothing End Sub
下拉菜单,指定sheet代码: Private Sub UserForm_Initialize() Dim Myr&, i&, nL% '下拉菜单部分(姓名,星期,时间) Dim brr, k Set d = CreateObject("Scripting.Dictionary") Myr = Range("v65536").End(xlUp).Row '名字循环 brr = Range("v3:v" & Myr).Value '名字循环 'brr = Sheets("Sheet1").Range("V3:V30").Value Me.ComboBox2.List = brr With Sheets("Sheet1") '星期循环 nL = .Range("xfd2").End(xlToLeft).Column brr = .Range("a2").Resize(1, nL).Value For i = 2 To 20 If brr(1, i) <> "" Then Me.ComboBox3.AddItem brr(1, i) d(brr(1, i)) = i End If Next Myr = .Range("a65536").End(xlUp).Row '时间循环 brr = .Range("a1:a" & Myr).Value For i = 3 To 22 If brr(i, 1) <> "" Then '加上这一句防止中间有空值 d(brr(i, 1)) = i Me.ComboBox1.AddItem brr(i, 1) End If Next End With ' Set d = Nothing End Sub
|
|
|
|
|
|
|