ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó²£¥Í¤£¦P¦WºÙworksheet

[µo°Ý] ¦p¦ó²£¥Í¤£¦P¦WºÙworksheet

§Ú·Q½Ð°Ý¦p¦ó§Q¥Îexcel VBA ¤@¦¸·s¼W5­Óworksheets,
¶¶«K§ó§ïworksheets¦WºÙ

Sub XXX()

For i = 1 to 5

     worksheets.Add
    ActiveSheet.Name = " Im=i"

Next

End sub

¥»©«³Ì«á¥Ñ mark15jill ©ó 2011-11-15 17:03 ½s¿è

Sub CODE_ST1()
'¿Ã¹õ§ó·sÃö³¬¡A´£¥ÜÃö³¬
Application.DisplayAlerts = False
Application.ScreenUpdating = True
   
'¬¡­¶Ã¯·s¼W
For AAA = 1 To 6 '1 TO 6 ¬O ³Ð³y6­Ó SHEET
    QQ = Sheet1.Range("A" & AAA).Value
'QQªº­È¬° SHEET1ªºAÄæ¦ìªº­È , ¦pªG¬O­n¦h¦r¦ê¦X¨Ö(¦p aÄæ¦ì©MbÄæ¦ì¦X¨Ö) «h ³o¦ê§ó§ï¬° QQ = SHEET1.RANGE("A"&AAA ).VALUE & SHEET1.RANGE("B"&AAA).VALUE  
Sheets.Add After:=Sheets(Sheets.Count)
    Sheets("Sheet" & QQ + 1).Select   'QQ+1¬OÁקK ¤@¶}©lªºSHEET1
    Sheets("Sheet" & QQ + 1).Name = QQ
Next AAA
End Sub

TOP

¥i¥H¤F! ÁÂÁÂ

TOP

¦^´_ 14# Helain
¬O³o¼Ëªº·N«ä¶Ü?

    "Im=" & i & "," &  "Ir=" & j"
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

®¦~ §Úª¾¹D¦p¦ó§e²{i&J, ¦b¤u§@ªí¦WºÙ
¤£¹L§Ú·Q­nª¾¹D­Y§Ú·Q§e²{"Im=i, Ir=j" ³o¼Ë¦r¦ê»PÅܼƪºµ²¦X¡A§Ú¸Õ¤£¥X¨Ó¡C

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-10-23 16:16 ½s¿è

¦^´_ 12# Helain


    «ç»ò©R¦W?°Ý§A¦Û¤v°Ú!
¤u§@ªí¦WºÙ´N¬O¤@­Ó¦r¦ê
¨â­ÓÅܼƧA­n«ç¼Ë§e²{?
¬Oi & j¶Ü?
¥ÎF8³v¦æ¥\¯à¬ÝÅܼƪºÅܤơA¨Ó°Ñ¦Ò§A·Q¦p¦ó±o¨ì¦r¦ê
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

§Ú·Q­n¦A°Ý, ¦pªG¦³2­ÓÅܼơA­n¦p¦ó©R¦W
Sub Remain_M()
    For i = 0 To 5
          for j = 0 to 5
              Worksheets.Add
              With ActiveSheet
             .Name = (i,j)
             End With
    Demand_M_2nd i
    Demand_R_2ndj
  Next
Next
End Sub

TOP

¦^´_ 10# Helain

¨ä¹ê³oÃä¤]¤£¥²¥Î¨ìWith³¯­z¦¡
ª½±µ¨Ï¥ÎActiveSheet .Name = "Im=" & i§Y¥i
³q±`¦b¦P¤@ª«¥óªº±Ô­z®É¡A¬°´î¤Öª«¥óªº¨Ï¥Î
¤~»Ý­n±N¸Óª«¥ó­n±Ô­zªºÄݩʧQ¥ÎWith ...End With³¯­z¦¡
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

·PÁÂHsieh¤j¤jªº¸Ñµª¡A
¤£¹L¡A¥i§_¬°§Ú¸ÑÄÀ¤@¤U¥Dµ{¦¡ªº³¡¤À
¬°¦ó­n¥Îwith ~ end with
³o¬O¤°»òª¬ªp¤U¥Îªº©O?

p.s. §Ú¬O·s¤â¤@¤Á³£ÁÙ¦bºN¯Á»P¾Ç²ß

TOP

¦^´_ 8# Helain

¬O³o¼Ë¶Ü?
  1. Sub Remain_M()
  2. For i = 0 To 5
  3.     Worksheets.Add
  4.     With ActiveSheet
  5.     .Name = "Im=" & i
  6.     End With
  7.     Demand_M_2nd i
  8. Next
  9. End Sub
  10. Function Demand_M_2nd(ByVal Im As Integer)

  11.     For i = 3 To 5
  12.    
  13.         If Worksheets(1).Cells(i, 2).Value - Im > 0 Then
  14.         
  15.             ActiveSheet.Cells(i, 2).Value = Cells(i, 2).Value - Im
  16.         
  17.         Else
  18.         
  19.             ActiveSheet.Cells(i, 2).Value = 0
  20.          
  21.         End If
  22.          
  23.     Next
  24.                  
  25. End Function
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD