[[20200521151457]] 『VBAユーザーフォーム』(こっこ) ページの最後に飛ぶ

[ 初めての方へ | 一覧(最新更新順) | 全文検索 | 過去ログ ]

 

『VBAユーザーフォーム』(こっこ)

こんにちは

現在ユーザフォームを作成し下記のように設定してるのですが
ユーザーフォームのリストボックスを直接コピーできるようにしたいですが
プロパティから設定できるでしょうか><よろしくお願いいたします。

Dim lastrow As Long
lastrow = Sheets("年表").Cells(Rows.Count, 1).End(xlUp).Row
With ListBox1
.ColumnHeads = True '花
.ColumnCount = 5
.ColumnWidths = "50;50;80;60;70"
.RowSource = "年表!" & Range("A8", "F" & lastrow).Address
End With

< 使用 Excel:Office365、使用 OS:Windows10 >


すみません後もう一つ

.ColumnCount の1のみをリストボックスで範囲選択し右クリックでコピーしたいです!
(こっこ) 2020/05/21(木) 15:18


引き続き
ShowModalはflashにしてあります><
(こっこ) 2020/05/21(木) 16:08

プロパティから設定、とか、ColumnCount の1のみをリストボックスで範囲選択、とか、ShowModalはflash、とか、何を言っているのか意味が判らないのですが…。 本当にExcelの話でしょうか? JavaScriptとかではなく?
 Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    Dim cBuf As String
    Dim i As Long

    If Button <> 2 Then Exit Sub

    With ListBox1
        For i = 0 To .ListCount - 1
            If .Selected(i) = True Then
                If cBuf <> "" Then
                    cBuf = cBuf & vbCrLf
                End If
                cBuf = cBuf & .List(i, 0)
            End If
        Next i
    End With

    If cBuf <> "" Then
        With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
            .SetText cBuf
            .PutInClipboard
        End With
        MsgBox "クリップボード転送済み", vbInformation
    End If
 End Sub
(???) 2020/05/22(金) 10:37

 RowSourceつかっているのだから、直接セルから取れば良いと思っているのだけれど。
 何に使うのか知らないけれど。
(BJ) 2020/05/22(金) 10:48

コメント返信:

[ 一覧(最新更新順) ]


YukiWiki 1.6.7 Copyright (C) 2000,2001 by Hiroshi Yuki. Modified by kazu.