Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2014, 09:10 AM
andrew12345 andrew12345 is offline vba: user input named argument Windows 7 32bit vba: user input named argument Office 2003
Novice
vba: user input named argument
 
Join Date: Nov 2014
Posts: 4
andrew12345 is on a distinguished road
Default vba: user input named argument

Hi all,
How can I make a user have a choice how to parse csv data from another worksheet: sep comma or semicolon.


I have written the follwing line of code:
Sheets("calc").Range("B2:B" & LR).TextToColumns DataType:=xlDelimited, ConsecutiveDelimiter:=True, Comma:=True, DecimalSeparator:="."
Now my idea was to have the user enter either "Comma" or "Semicolon" into a variable via an Inputbox which I could then use in the named argument. However, Excel does not seem to accept a variable instead of a named argument, at least I don't know how to code it.
Can someone tell me how to code it, or give me another idea?
Thanks for your suggestions.
Andreas
Reply With Quote
  #2  
Old 11-18-2014, 07:45 AM
whatsup whatsup is offline vba: user input named argument Windows 7 64bit vba: user input named argument Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Hi Andreas
You will have to convert whatever user is offering as his choice via inputbox to a boolean-variable, to meet this syntax (as example):
Code:
Sub InsertOption()
Dim blnsemicolon As Boolean
Dim blncomma As Boolean
 
'Select Comma:
blnsemicolon = False
blncomma = True
 
Range("A3").TextToColumns DataType:=xlDelimited, ConsecutiveDelimiter:=False, _
        Semicolon:=blnsemicolon, Comma:=blncomma
End Sub
Cheers
Reply With Quote
  #3  
Old 11-18-2014, 08:18 AM
andrew12345 andrew12345 is offline vba: user input named argument Windows 7 32bit vba: user input named argument Office 2003
Novice
vba: user input named argument
 
Join Date: Nov 2014
Posts: 4
andrew12345 is on a distinguished road
Default

Thanks Whatsup,

that's exactly what I needed!

Andreas
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
vba: user input named argument Formula In Excel To Prompt User To Input Date pclutts Excel Programming 4 08-31-2014 12:45 PM
vba: user input named argument User input to a variable on the document dsm1995gst Word VBA 1 09-03-2013 03:43 PM
vba: user input named argument Replacing text with user input.?.?.? brad1977 Word 3 11-20-2012 10:20 AM
vba: user input named argument Restricting User Input on a TextBox (and setting focus) joatmon Excel Programming 1 06-05-2012 03:01 PM
Look up an array based on user input johnsmb Excel 2 01-07-2011 01:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft