ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help with Editing VB (a really beginner question) (https://www.excelbanter.com/excel-worksheet-functions/238068-help-editing-vbulletin-really-beginner-question.html)

nadhra

Help with Editing VB (a really beginner question)
 
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

Simon Lloyd[_338_]

Help with Editing VB (a really beginner question)
 

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

nadhra;431216 Wrote:
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



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=119752


nadhra

Help with Editing VB (a really beginner question)
 
(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!

On Jul 27, 3:30*pm, Simon Lloyd
wrote:
That code already runs on all selected cells, what is it you mean?, text
to coulmns is usually only performed once on a range.

nadhra;431216 Wrote:



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


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile:http://www.thecodecage.com/forumz/member.php?userid=1
View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=119752



Simon Lloyd[_339_]

Help with Editing VB (a really beginner question)
 

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

Code:
--------------------
Sub Text_to_columns()
Dim IB as String
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:=True
End Sub

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


nadhra;431233 Wrote:
(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!

On Jul 27, 3:30*pm, Simon Lloyd
wrote:
That code already runs on all selected cells, what is it you mean?,

text
to coulmns is usually only performed once on a range.

nadhra;431216 Wrote:



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


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage - Microsoft Office Help - Microsoft

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

------------------------------------------------------------------------
Simon Lloyd's Profile:'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread:'Help with Editing VB (a really beginner question) -

The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...d.php?t=119752)



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=119752



All times are GMT +1. The time now is 07:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com