·µ»ØÊ×Ò³
µ±Ç°Î»ÖÃ: Ö÷Ò³ > Excel½Ì³Ì > Excel2013½Ì³Ì >

ExcelÖÆ×÷ÁíÀà¡°ÓʼþºÏ²¢¡±(2)

ʱ¼ä:2015-04-23 12:39À´Ô´:Office½Ì³ÌѧϰÍø www.office68.com±à¼­:ÂóÌïÊØÍûÕß

Èý¡¢ÉèÖÃ΢µ÷Ïî°´Å¥

ÉèÖÃ΢µ÷ÐòºÅµÄ°´Å¥£¬¿ÉÒÔͨ¹ýµã»÷“΢µ÷ÐòºÅ”°´Å¥£¬Ñ¡ÔñÊý¾ÝÔ´ÖÐÒª´òÓ¡µÄij¸öѧÉúµÄ³É¼¨£¬ÈÃÆäÏÔʾÔÚ“¿ÆÄ¿¼°³É¼¨”µÄ±í¸ñÖУ¬¾Í¿ÉÒԲ鿴¼°´òÓ¡¡£

ÉèÖ÷½·¨£ºÖ´ÐГÊÓͼ→¹¤¾ßÀ¸→´°Ì唣¬´Ó“´°Ìå”ÖУ¬Ñ¡Ôñ“΢µ÷Ï¬ÍϳöÒ»¸ö“΢µ÷Ïî”°´Å¥À´£¬ÈçͼÖÐËùʾ“΢µ÷ÐòºÅ”Ï·½ÄǸöÒ»Ñù¡£²¢ÉèÖÓ΢µ÷Ï¬ÓÒ¼üÑ¡Ôñ“΢µ÷Ïî°´Å¥→ÉèÖÿؼþ¸ñʽ→¿ØÖÆ”£¬ÔÚ“¿ØÖÆ”ÏîÏÂÃ棬×îСֵÉèΪ1£¬µ¥Ôª¸ñÁ´½ÓÑ¡Ôñ$H$2£¬ÆäËûΪĬÈÏ£¬°´“È·¶¨”¼´¿É¡£

ËÄ¡¢ÉèÖÃÅúÁ¿´òÓ¡¹¦ÄÜ

ÔÚK8µ¥Ôª¸ñÊäÈë“¿ªÊ¼ÐòºÅ”£¬K9µ¥Ôª¸ñÊäÈ듽áÊøÐòºÅ”£¬ÔÙÑ¡ÖÐL8µ¥Ôª¸ñÉèÖÃÆä“ÓÐЧÐÔ”£¬Ñ¡Ôñ²Ëµ¥ÃüÁî“Êý¾Ý→ÓÐЧÐÔ→ÉèÖÔ£¬ÔÚÆä“ÉèÖÔÏîÏ·½£¬“³äÐí”Ñ¡Ôñ“ÐòÁД£¬“À´Ô´”Ñ¡Ôñ=$M$2:$M$6¡£Í¬ÀíÉèÖÃL9µ¥Ôª¸ñ“ÓÐЧÐÔ”¡£

1204asw-ÓʼþºÏ²¢03

03

1204asw-ÓʼþºÏ²¢04

04

±àдºêÃüÁÔÚ“´òÓ¡ÓÔ¹¤×÷±íÀִÐв˵¥“¹¤¾ß→ºê→ºê→ºêÃû”£¬ÊäÈë“ÅúÁ¿´òÓ¡”£¬“λÖÔѡÔñ“µ±Ç°¹¤×÷äß”£¬µã»÷“´´½¨”£¬°ÑÏÂÃæµÄ´úÂëд½øÈ¥¼´¿É¡£

ºê´úÂ룺

Sub ÅúÁ¿´òÓ¡()

Application.ScreenUpdating = False

Dim a As Integer, b As Integer, i As Integer

a = Range("L8").Value ‘ÉèÖÃÅúÁ¿´òÓ¡µÄ¿ªÊ¼ÐòºÅ

b = Range("L9").Value ‘ÉèÖÃÅúÁ¿´òÓ¡µÄ½áÊøÐòºÅ

If b <= a Then

MsgBox ("ÅúÁ¿´òÓ¡½áÊøÐòºÅСÓÚ¿ªÊ¼ÐòºÅ£¬ÇëÖØÐÂÊäÈë!")

Else

For i = a To b

Range("H2").Value = i ‘H2Òª´òÓ¡µÄÐòºÅ

ActiveWindow.SelectedSheets.PrintOut

Next

End If

Application.ScreenUpdating = True

End Sub

ÔÙÔÚ±í¸ñÖÐÌí¼ÓÒ»¸ö°´Å¥£¬Ñ¡Ôñ²Ëµ¥ÃüÁî“ÊÓͼ→¹¤¾ßÀ¸→´°Ì唣¬´Ó“´°Ìå”ÖУ¬Ñ¡Ôñ“°´Å¥”£¬ÍϳöÒ»¸ö“°´Å¥”À´£¬ÔÚ“Ö¸¶¨ºê”ÖУ¬Ñ¡Ôñ±àÖƵēÅúÁ¿´òÓ¡”ºêÃüÁȷ¶¨£¬°Ñ“°´Å¥”ÉϵÄÃû³Æ¸ÄΪ“ÅúÁ¿´òÓ¡”£¬×÷ΪÅúÁ¿´òÓ¡µÄ°´Å¥£¬¼´¿ÉʵÏÖÅúÁ¿´òÓ¡¹¦ÄÜ¡£Ó¦Óùý³ÌÖУ¬Ö»Ðè¸Ä±ä“³É¼¨”µÄ¹¤×÷±íÖÐÊý¾ÝÔ´¼´¿É¡£

------·Ö¸ôÏß----------------------------
±êÇ©(Tag):excel excel2007 excel2010 excel2013 excel2003 excel¼¼ÇÉ excel½Ì³Ì excelʵÀý½Ì³Ì
------·Ö¸ôÏß----------------------------
ÍƼöÄÚÈÝ
²ÂÄã¸ÐÐËȤ