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

[µo°Ý] °w¹ïEXCEL VBA¡@Àx¦s®æÄæ¦ì­Ó¼Æ·s¼W¤À­¶

[µo°Ý] °w¹ïEXCEL VBA¡@Àx¦s®æÄæ¦ì­Ó¼Æ·s¼W¤À­¶

¥»©«³Ì«á¥Ñ s13983037 ©ó 2014-11-22 23:23 ½s¿è

¤j¤j­Ì§A­Ì¦n §Ú·Q½Ð°Ý¤@¤U §Ú·Q°w¹ï ¤u§@ªíªºÀx¦s®æ±qAÄ檺¸ê®Æ «Ø¥ß¤@­Ó¤@­Óªº¤À­¶
¥i¥H¥h°w¹ïAÄ榳´X­Ó¸ê®Æ´N«Ø¥ß´X­Ó¤À­¶¶Ü ·Q§â¬õ¦âªº³¡¤À§ï¦¨Ãþ¦ü¦¨Worksheets.Count
¤£µM¨C¦¸³£·|¸õ¥X ¦p¹Ïªþ¥ó2 ·PÁÂÀ°¦£

----·Q­×§ï----
Dim I as Integer
    For I = 1 To 100
        Sheets.Add after:=Sheets(Sheets.Count)
        Sheets(Sheets.Count).Name = Sheets(1).Range("A" & I)
    Next
----·Q­×§ï----

-----¬ÛÃö½d¨Ò-----
For i = 1 To Worksheets.Count
Cells(i, 1) = Sheets(i).Name
Next i

Q7.png (8.69 KB)

ªþ¥ó1

Q7.png

Q8.png (12.97 KB)

ªþ¥ó2

Q8.png

¤j¤j­Ì§A­Ì¦n §Ú·Q½Ð°Ý¤@¤U §Ú·Q°w¹ï ¤u§@ªíªºÀx¦s®æ±qAÄ檺¸ê®Æ «Ø¥ß¤@­Ó¤@­Óªº¤À­¶
¥i¥H¥h°w¹ïAÄ榳´X­Ó ...
s13983037 µoªí©ó 2014-11-22 23:22
  1. Sub nn()
  2.   Dim lRow&
  3.   
  4.   lRow = 1
  5.   Do While Cells(lRow, 1) <> ""
  6.     With Sheets.Add(after:=Sheets(Sheets.Count))
  7.       .Name = Sheets(1).Cells(lRow, 1)
  8.       lRow = lRow + 1
  9.     End With
  10.   Loop
  11. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# luhpro


    ¤j¤j±z¦n §Ú·Q½Ð°Ý¤@¤U ¦pªG§Ú·Q§å¦¸­×§ï¤u§@ªí Sheets.Add(after:=Sheets(Sheets.Count))³o­Ó³¡¥÷¬O§_­n§ó§ï¦¨¬Y­Ó¨ç¼Æ??ÁÙ¬O©ÎªÌ §Ú¥i¥H§ì¨ìAÄ檺¶µ¥Ø­Ó¼Æ
·í§Ú¥h§ìAÄ檺¶µ¥Ø­Ó¼Æ ·|Åܦ¨ ¼Æ¦r¥i¥H§ì ¦ý¦pªG¬O¦r¦ê§ì¤£¤F ³o¦³¨ä¥L¸Ñ¨M¤è¦¡¶Ü ³Â·Ð¤F ·PÁÂ
Worksheets(1).Range("A:A").Select
RowCounts = Application.Count(Selection)

Dim lRow&
  lRow = 1
  Do While Cells(lRow, 1) <> ""
    With Sheets.Add(after:=Sheets(Sheets.Count))
      .Name = Sheets(1).Cells(lRow, 1)
      lRow = lRow + 1
    End With
  Loop

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2014-11-25 23:32 ½s¿è
¦^´_  luhpro
    ¤j¤j±z¦n §Ú·Q½Ð°Ý¤@¤U ¦pªG§Ú·Q§å¦¸­×§ï¤u§@ªí Sheets.Add(after:=Sheets(Sheets. ...
s13983037 µoªí©ó 2014-11-23 10:55

µ{¦¡¤w¸g¹F¨ì§Aªº»Ý¨D¤F³á.

Dim lRow& ' ©w¸q lRow ¬°ªø¾ã¼Æ
lRow = 1 ' ±q¦C¸¹¬° 1 (§Y²Ä 1 ¦C) ¶}©l§ì¦WºÙ
  Do While Cells(lRow, 1) <> "" ' °õ¦æ°j°é,¨Ì¦¸§ì¦WºÙª½¨ì [A?] Àx¦s®æ¨S¸ê®Æ¬°¤î, ?§Y¦C¸¹¦b¦¹¬°lRow
    With Sheets.Add(after:=Sheets(Sheets.Count)) ' ·s¼W¤@­Ó Sheet ©ñ¦b³Ì«á­±, ¦WºÙ¬°¨t²Î¹w³] (±q¦¹¦æ¶}©lª½¨ì End With , ¤§¶¡¥H . ¶}ÀYªºª«¥ó, °õ¦æ®É·|¥ý¥H ¦¹ Sheet ¤u§@ªíª«¥ó ¨ú¥N¶}ÀYªº . ¦A°õ¦æ«ü¥O)
      .Name = Sheets(1).Cells(lRow, 1) ' ±N¦¹ Sheet ¦WºÙ§ó§ï¬° [A?] Àx¦s®æ¤ºªº­È, ?§Y¦C¸¹¦b¦¹¬°lRow
      lRow = lRow + 1 ' ¦C¸¹¥[1
    End With
  Loop ' Ä~Äò°j°é

TOP

        ÀR«ä¦Û¦b : ¤â¤ß¦V¤U¬O§U¤H¡A¤â¤ß¦V¤W¬O¨D¤H¡F§U¤H§Ö¼Ö¡A¨D¤Hµh­W¡C
ªð¦^¦Cªí ¤W¤@¥DÃD