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

¦p¦óÅýListBox¥i¥HÀHµÛÀx¦s®æ¤ºªº¼Æ¦rÅܤÆ

¦p¦óÅýListBox¥i¥HÀHµÛÀx¦s®æ¤ºªº¼Æ¦rÅܤÆ

¦U¦ì«e½ú½Ð°Ý¤@¤U

¦p¦óÅýListBoxÅã¥Ü¥i¥HÀHµÛÀx¦s®æ(A1)¤ºªº¼Æ¦rÅܤÆ
ÁÙ¬O­n¥ÎTextbox??

VBA»¡©ú
»yªk

¹Bºâ¦¡.Address(RowAbsolute, ColumnAbsolute, ReferenceStyle, External, RelativeTo)

¹Bºâ¦¡   ¥Nªí Range ª«¥óªºÅܼơC

°Ñ¼Æ

¦WºÙ ¥²­n/¿ï¥Î ¸ê®ÆÃþ«¬ ´y­z
RowAbsolute ¿ï¥Î Variant ¦pªG¬° True¡A«h·|¥Hµ´¹ï°Ñ·Óªº§Î¦¡¶Ç¦^¹ï¦Cªº°Ñ·Ó¡C¹w³]­È¬° True¡C
ColumnAbsolute ¿ï¥Î Variant ¦pªG¬° True¡A«h·|¥Hµ´¹ï°Ñ·Óªº§Î¦¡¶Ç¦^¹ïÄ檺°Ñ·Ó¡C¹w³]­È¬° True¡C
ReferenceStyle ¿ï¥Î XlReferenceStyle °Ñ·Ó¼Ë¦¡¡C¹w³]­È¬° xlA1¡C
External ¿ï¥Î Variant ¦pªG¬° True «h·|¶Ç¦^¥~³¡°Ñ·Ó¡C¦pªG¬° False «h·|¶Ç¦^°Ï°ì°Ñ·Ó¡C¹w³]­È¬° False¡C
RelativeTo ¿ï¥Î Variant ¦pªG RowAbsolute ¤Î ColumnAbsolute ³£¬° False¡A¦Ó¥B ReferenceStyle ¬° xlR1C1¡A«h¥²¶·¥]§t¬Û¹ï°Ñ·Óªº°_©lÂI¡C¦¹¤Þ¼Æ§Y¬°©w¸q°_©lÂIªº Range ª«¥ó¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_  syuan

§Aªº·N«ä¬O¿ï¤@±iªíªº¹ï§a? ¥i¥H³o¼Ëªº

dim strsht as string
strsht ="sheet1"

.. ...
kimbal µoªí©ó 2010-8-31 20:04


·PÁÂkimbal¤jªº±Ð¾É

¤p§Ì¸Õ¤F¤@¤U¡A¨Ã±N±zªº»yªkµy§ï¤F¤@¤U¡]±N«Å§i®³±¼¤F¡^

ElseIf UserForm1.ListBox1.ListIndex = 6 And UserForm1.ListBox2.ListIndex = 2 And UserForm1.ListBox3.ListIndex = 0 Then
With UserForm2.ListBox1
     .RowSource = Worksheets("xxxx").Range("M6:N9").Address(, , , 1)
     .ColumnCount = 2
     .ColumnWidths = "100"
End With
UserForm2.Show

³o¼Ë°õ¦æ«á¡A¤@¼Ë¥i¥H¹F¨ì¤p§Ì­ì¥ýªº»Ý¨D¡ã¡ã

¤£¹L¤p§Ì­ì¥ýªºµ{¦¡¬O¦³«Å§iªº¡A¥Î±zªº»yªk«á¡A¤£¦ý¦æ¼Æ´î¤Ö¤F¡A­ì¥ýªºªº«Å§i¤]¤£»Ý­n¤F¡I¯u¬O¤@Á|¼Æ±o¡I

¤£¹L¤p§Ì¦n©_ªº¬O¡A¦b.range("m6:n9")ªº«á­±¦³­Ó¥[¤W.Address(,,,1)

¤p§Ì·Q¨Ó·Q¥h¡AÁÙ¬O¤£À´·N«ä¡I§Æ±æ±z©Î¬O¦U¦ì¥ý¶i¯àÀ°¤p§Ì¸Ñ¤@¤U´b¡I

¯¬¦U¦ì¤¤¬î¨Î¸`´r§Ö¡ã¡ã
¿ú¬O«Ü±I²öªº¡A©Ò¥H·|·Q¿ìªk»E¦b¤@°_¡I

TOP

ª±¤@¤U¤½¦@©w¸q
¤Á´«Àɮפu§@ªí¸Õ¸Õ¬Ý¦³¬Æ»ò®t§O ¦@¥Î©w¸q.rar (9.3 KB)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# syuan

§Aªº·N«ä¬O¿ï¤@±iªíªº¹ï§a? ¥i¥H³o¼Ëªº

dim strsht as string
strsht ="sheet1"

.....
ElseIf UserForm1.ListBox1.ListIndex = 6 And UserForm1.ListBox2.ListIndex = 1 And UserForm1.ListBox3.ListIndex = 1 Then
With UserForm2.ListBox1
     .RowSource = worksheets(strsht).range("m5:n8").address(,,,1)
     .ColumnCount = 2
     .ColumnWidths = "100"
End With
UserForm2.Show

¥H¤W¦^¶Çsheet1
§âstrsht="sheet1"  ´«¦¨ "sheet2" ´N·|¦^¶Çsheet2 ªº
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¦^´_ 7# GBKEE
·PÁÂGBKEE¤jªº±Ð¾É

¤p§Ì©|¦³¤@¨Æ¤£¸Ñ

¦pªG¦bEXCEL¸Ì¦³¦n´X­¶ªº¤À­¶(Sheet1¡BSheet2¡BSheet3¡D¡D¡D¡D¡^¡A¤p§Ì¦b#6©Ò¼gªº»yªk¡A´N¬O¦]¬°¦³¦n´X­¶ªº¤À­¶¡A©Ò¥H¤~³o¼Ë¼g¡I

¤p§Ì¤£¤~¡A¨º¦pªG·Q¥H±z³o¥y»yªk¥h­×§ï¤p§Ìªºµ{¦¡®É¡A½Ð°Ý­n¦p¦ó¥h§ï©O¡H
ListBox1.RowSource = xxxx.Address(, , , 1)

µù¡G¥H¤U¬°¤p§Ì®M¥Î±zªº»yªk¨Ó­×§ï¡Aµo²{¦n¹³¶È·|¨q¥X²Ä¤@­ÓSheetªº¤º®e¦Ó¤w¡I
ElseIf UserForm1.ListBox1.ListIndex = 6 And UserForm1.ListBox2.ListIndex = 1 And UserForm1.ListBox3.ListIndex = 1 Then
With UserForm2.ListBox1
     .RowSource = "m5:n8"
     .ColumnCount = 2
     .ColumnWidths = "100"
End With
UserForm2.Show


¥H¤W¡A¯¬¦w±d¡I
¿ú¬O«Ü±I²öªº¡A©Ò¥H·|·Q¿ìªk»E¦b¤@°_¡I

TOP

¦^´_ 6# syuan
ListBox1.List = xxxx.Value                             ·|©T©wListªº­È,¬°³Ìªì³]©w®Éxxxxªº­È
ListBox1.RowSource = xxxx.Address(, , , 1)   Listªº­È,·|ÀHxxxxªº­È ¦Ó§ïÅÜ

TOP

¤p§Ìªº¼gªk¡]¦n¹³¤ñ¸û¦h¤F¤@ÂI¡D¡D¡D¡D¡D¡D¡^


Private Sub UserForm_Initialize()
Dim xxxx AS Range

Set xxxx = Sheets("xxxx").Range("a1:b2")  

With UserForm1.ListBox1
     .ColumnCount = xxxx.Columns.Count
     .ColumnWidths = "100"
     .List = xxxx.Value
End With
End sub


¥H¤W¶È°Ñ¦Ò¡D¡D¡D¡D¡D
¿ú¬O«Ü±I²öªº¡A©Ò¥H·|·Q¿ìªk»E¦b¤@°_¡I

TOP

¥i¥H¥Î³á~~
ÁÂÁ¤j¤j~~
·P®¦~~

TOP

¦^´_ 3# catmm
  1. Private Sub UserForm_Initialize()
  2.     With ListBox1
  3.         .RowSource = "a1:b6"
  4.         .ColumnCount = 2
  5.     End With
  6. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD