Help with Editing VB (a really beginner question)

N

nadhra

Hi,

Can anyone please help me to edit this code :

Selection.TextToColumns Destination:=Range("B31"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True,
OtherChar _
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1)),
TrailingMinusNumbers:=True
End Sub

so that I can run the macros for every cell selected?

and later, do every cell and then run the macros on other sheet in the
worksheet?

Thank you very much!

Nadhra
 
S

Simon Lloyd

That code already runs on all selected cells, what is it you mean?, tex
to coulmns is usually only performed once on a range

nadhra;431216 said:
Hi

Can anyone please help me to edit this code

Selection.TextToColumns Destination:=Range("B31")
DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False
Tab:=True,
Semicolon:=False, Comma:=False, Space:=False, Other:=True
OtherChar
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1))
TrailingMinusNumbers:=Tru
End Su

so that I can run the macros for every cell selected

and later, do every cell and then run the macros on other sheet in th
worksheet

Thank you very much

Nadhr

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
N

nadhra

(further explanation)

I recorded that Macro when I was editing cell B31, now I want to run
the code for cell, G31 and X31 (for example).

How do I edit the Macro so that it can do so? (i.e I click 'Run Macro'
and vwallaaa, changed 'current cell condition' to 'wanted cell
condition'

Thank you so much!
 
S

Simon Lloyd

That code will do that, where you see
Code
-------------------
Selection.......whateve
-------------------
it means that that code will run on the selection, the only problem i
the destination cell so how about this

Code
-------------------
Sub Text_to_columns(
Dim IB as Strin
IB= Application.Inputbox("Enter your destination cell","Destination"
Selection.TextToColumns Destination:=Range(IB)
DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False
Tab:=True,
Semicolon:=False, Comma:=False, Space:=False, Other:=True
OtherChar
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1))
TrailingMinusNumbers:=Tru
End Su

-------------------

nadhra;431233 said:
(further explanation

I recorded that Macro when I was editing cell B31, now I want to ru
the code for cell, G31 and X31 (for example)

How do I edit the Macro so that it can do so? (i.e I click 'Run Macro
and vwallaaa, changed 'current cell condition' to 'wanted cel
condition

Thank you so much

On Jul 27, 3:30*pm, Simon Lloyd <[email protected]
wrote



Office Discussion' (http://www.thecodecage.com)

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top