VBA程序执行结果有时候不对,美女帅哥帮小弟我分析下

fieldset{padding:10px;}

VBA程序执行结果有时候不对,美女帅哥帮我分析下Sub test() Dim r1 As Range, r2 As Range Dim p, q ‘ActiveSheet.DrawingObjects.Select ‘MsgBox Sheet9.Cells(1, 4).Value For i = 1 To 15 [a:i].HorizontalAlignment = xlCenter For j = 5 To 13 If Trim(Sheet9.Cells(i, j)) <> "" Then p = Sheet9.Cells(i, j).Value ‘ MsgBox (p) Set r1 = Rows(i).Find(p) End If If Trim(Sheet9.Cells(i + 1, j)) <> "" Then q = Sheet9.Cells(i + 1, j).Value ‘MsgBox (q) Set r2 = Rows(i + 1).Find(q) End If Next ActiveSheet.Shapes.AddLine r1.Left + r1.Width * 0.5, r1.Top + r1.Height * 0.7, r2.Left + r2.Width * 0.5, r2.Top + r2.Height * 0.3 Next End Sub每行有一个数据,将数据用线条连接起来,跟3D走势图类似——解决方案——————————————————–不是美女不是帅哥的问一下哪里不对,怎么不对?——解决方案——————————————————–VB code

Sub test()    Dim r1 As Range, r2 As Range    Dim p, q    'ActiveSheet.DrawingObjects.Select    'MsgBox Sheet9.Cells(1, 4).Value    For i = 1 To 5         [a:i].HorizontalAlignment = xlCenter         If Trim(Sheet1.Cells(i, i)) <> "" Then         p = Sheet1.Cells(i, i).Value         ' MsgBox (p)         Set r1 = Rows(i).Find(p)         End If             If Trim(Sheet1.Cells(i + 1, i + 1)) <> "" Then         q = Sheet1.Cells(i + 1, i + 1).Value         'MsgBox (q)         Set r2 = Rows(i + 1).Find(q)         End If            ActiveSheet.Shapes.AddLine r1.Left + r1.Width * 0.5, r1.Top + r1.Height * 0.7, r2.Left + r2.Width * 0.5, r2.Top + r2.Height * 0.3    Next    End Sub路灯和我之间,究竟谁是谁的过客,

VBA程序执行结果有时候不对,美女帅哥帮小弟我分析下

相关文章:

你感兴趣的文章:

标签云: