返回列表 上一主題 發帖

[發問] {請益} 下拉式選單有內容資料,如何用VBA或其他方式呈現數據在特定顏色表格內?

不知道是不是你要的??  
如果只是填入數值,用這個。   如果要連顏色都變,就改成 copy & paste

Sub test()
    input_button = Cells(3, 9)
    a = 2
    a = input_button + (input_button * a)
    c = 11
    For b = 3 To 6
        Cells(b, 10) = Cells(c, a)
        c = c + 1
    Next b
End Sub

TOP

這種有規律的,再稍微推敲一下,可以得到公式

Sub test()
    input_button = Cells(3, 9)
    a = 2
    a = input_button + (input_button * a)
    c = 11
    For b = 3 To 6
        Cells(c, a) = Cells(b, 10)
        Cells(18, a - 1) = Cells(3, 12)
        Cells(19, a + 1) = Cells(5, 12)
        c = c + 1
    Next b
End Sub

TOP

        靜思自在 : 站在半路,比走到目標更辛苦。
返回列表 上一主題