Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

[vba excel] MessageFormat のbak

More than 1 year has passed since last update.

以前仕事中によく使われていた共通メソッド

'*******************************************************
'MessageFormatの使い方の例 ↓
' Dim args(2) As String
' args(0) = "test1"
' args(1) = "test2"
' args(2) = "test3"
' MsgBox (MessageFormat("this sheet{0},{1},{2} has done.", args))
'*******************************************************
Function MessageFormat(targetMsg As String, args() As String) As String
    Dim index  As Integer
    For index = 0 To UBound(args)
        targetMsg = Replace(targetMsg, "{" & index & "}", args(index))
    Next index
    MessageFormat = targetMsg
End Function
JustsuQ
最近Youtuberに興味が持ち始め。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away