摘要:Public Sub replace()For i = 1 To 10 For j = 1 To 8 If Sheet1.Cells(i, 1) <> "" And Sheet2.Cells(j, 2) <> "" And Sheet1.Cells(i, 1).Value = Sheet2.Cells(j, 2).Value Then 'MsgBox (Cells(J, 2).Value) Sheet1.Cells(j, 3) = Sheet2.Cells(j, 2) End If Next jNext iEnd Sub持
阅读全文
随笔分类 - EXCEL
VBA
摘要:Sub b()For i = 1 To 120 Step 1 '从第1行至第9行,如果行数较多,将9改为行数For t = 1 To 120 Step 1If Cells(i, 1) = Cells(t, 3) _ThenCells(i, 1).Font.Color = RGB(255, 0, 0): Cells(t, 3).Font.Color = RGB(255, 0, 0)'必须有空格 换行符(注释的标点需是英文标点,并且不能在换行符一行,并且不能在上面换行符后)Next tNext iEnd Sub2011.12.12更新(整合)Sub b()For i = 1 To
阅读全文
摘要:Sub adde()For i = 1 To 6 Step 1If Cells(i, 1).Value < 100 Then _Cells(i, 1) = Cells(i, 1) & "yes"Next iEnd Sub
阅读全文
摘要:http://club.excelhome.net/thread-803349-1-1.html1,普通写法Public Sub q()Dim ar, i%ar = Range("a1:a294")For i = 1 To 294ar(i, 1) = "'" & ar(i, 1)Next iRange("a1:a294") = arRange("a1:a294").NumberFormatLocal = "@"Range("a1:a294").Replace
阅读全文
摘要:http://zhidao.baidu.com/question/153614823.htmla 车 3b 车 4c 车 25d 车 1e 车 15f 车 1a 秘 28b 秘 49c 秘 7d 秘 24f 秘 1a 考 6b 考 9f 考 12如何转换成如下表格: 车 秘 考a 3 28 6b 4 49 9c 25 7 d 1 24 e 15 f 1 1 12非常紧急,谢谢!用数据透视表1,选择:数据——数据透视表和数据透视图——下一步2,选择MICROSOFT OFFICE EXCEL,下面选择数据透视表——下一步3,选择区域选择所有数据——下一步4,新建工作表——完成然后把字母那列拖入到
阅读全文
摘要:方法一,使用vlookup函数。方法二:使用countif
阅读全文
摘要:PrivateSubCommandButton1_Click()SelectCaseTextBox2.TextCase"aaaa"Sheets("sheet2").ActivateSheets("sheet3").Visible=FalseCase"bbbb"Sheets("sheet3").ActivateSheets("sheet2").Visible=FalseEndSelectUnloadMeEndSub无锡写的
阅读全文