• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

TAB?

Hi,

How to insert a tab key between two strings?

e.g

StrA & "   " & StrB


Thanks!
0
cplau
Asked:
cplau
  • 3
  • 2
  • 2
  • +1
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
StrA & vbTab & StrB
0
 
Crash2100Commented:
or

msgbox StrA & chr(9) & StrB
0
 
rspahitzCommented:
Or even....

strNewString = StrA & "x" & StrB
Mid$(strNewString,Len(StrA)+1,1) = vbTab

or

StrA & "¡" & StrB

where ¡ is the key combination Alt-NumericKeyPad_9


(emoreau get the points for most efficient solution!)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
amebaCommented:
or:
    Dim strA As String, strB As String
    strA = "hello,"
    strB = "world"
    MsgBox Join(Array(strA, strB), vbTab)
0
 
Crash2100Commented:
since we all have an equally valid answer we should each get 50 points  :-)
0
 
rspahitzCommented:
Hey...I offered two answers...I want 100 points ;)

And what about:

strCombined = StrA & "~" & StrB
strCombined = replace("~", vbTab) ' assuming StrA does not contain "~"

or

(variation on my first)

strCombined = StrA & "~" & StrB
intDelimPosit = instr(strCombined, "~")
Mid$(strNewString,intDelimPosit,1) = vbTab

--
My choices are more geared toward replacing a delimiter AFTER the strings are already appended.  (i.e. "insert a tab [character] between two " previously combined strings.)

--
Aso note that if this string is going to be sent as keystrokes to an application, you amy want to replace the "tab key" with a string of spaces instead: String$(8, " ") or space$(8)
0
 
amebaCommented:
>insert a tab [character]
The question was insert 'tab key'.  Maybe this should be posted in hardware section.  ;-)
0
 
rspahitzCommented:
I was hoping for a comment  :(

hmmm I'll add my own:

"insert a tab key between two strings"

Go to the keyboard and pry off the button next to the "Q" key marked "Tab".  Go to the store and but some twine.  Cut off a piece of twine, then cut it in half.  Place the "Tab" button between the pieces of twine.  Mission accomplished...  LOL...  (Thanks for the idea ameba!)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now