Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default calling variable within string

i am a novice in VBA programming. I am looking to call a variable
within a string.

for example

a = "E13" (Cell reference)
Range("a: L30").select (Giving me error because variable a cannot
be called in within the Range)

I intend to select cells in the range E 13 to L 30. Any way to make
this work? Basically the starting cell of this range is dynamic and I
want to select that range.

Thanks,
Rachit

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default calling variable within string

Hi Rachit,

range(a & ":l30").Select

--
Kind regards,

Niek Otten

wrote in message oups.com...
|i am a novice in VBA programming. I am looking to call a variable
| within a string.
|
| for example
|
| a = "E13" (Cell reference)
| Range("a: L30").select (Giving me error because variable a cannot
| be called in within the Range)
|
| I intend to select cells in the range E 13 to L 30. Any way to make
| this work? Basically the starting cell of this range is dynamic and I
| want to select that range.
|
| Thanks,
| Rachit
|


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default calling variable within string

thanks a lot... also another question..

if i know that a cell row is i and cell column is j (i and j are
variables), how do i get it in the regular cell address
(Alphabet-number) format..like i=5, j= 13, how do i get E 13
and assign it as

a = "e13"

thanks again!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default calling variable within string

Cells(i,j).Value = "a"

BTW if i is row and =5, and j is column and 13, then you are talking M5 not
E13.

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

wrote in message
ups.com...
thanks a lot... also another question..

if i know that a cell row is i and cell column is j (i and j are
variables), how do i get it in the regular cell address
(Alphabet-number) format..like i=5, j= 13, how do i get E 13
and assign it as

a = "e13"

thanks again!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default calling variable within string

Hi Rachit,

cells(i,j).address(false,false)

Please start a new thread for a new question
--
Kind regards,

Niek Otten

wrote in message ups.com...
| thanks a lot... also another question..
|
| if i know that a cell row is i and cell column is j (i and j are
| variables), how do i get it in the regular cell address
| (Alphabet-number) format..like i=5, j= 13, how do i get E 13
| and assign it as
|
| a = "e13"
|
| thanks again!
|




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default calling variable within string

i think i have not put it correctly. I do not want to assign "a" to
E13, rather i want to assign the string E13 which is obtained through
i=13, j=5 (i and j are variables) to a variable called 'a'.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default calling variable within string

Well in that case you want Niek's alternative solution, but you will still
get M5 with those variable values, not E13. If i is row it should be 13 not
5!

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

wrote in message
oups.com...
i think i have not put it correctly. I do not want to assign "a" to
E13, rather i want to assign the string E13 which is obtained through
i=13, j=5 (i and j are variables) to a variable called 'a'.



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default calling variable within string

Absolutely right. The order in the worksheet is Column, Row, (in the A1 Reference style; not in the R1C1 reference style) and in
all VBA functions it is Row, Column.
I don't even feel dumb anymore is I confuse them once more!

--
Kind regards,

Niek Otten

"Bob Phillips" wrote in message ...
| Well in that case you want Niek's alternative solution, but you will still
| get M5 with those variable values, not E13. If i is row it should be 13 not
| 5!
|
| --
| HTH
|
| Bob Phillips
|
| (remove xxx from email address if mailing direct)
|
| wrote in message
| oups.com...
| i think i have not put it correctly. I do not want to assign "a" to
| E13, rather i want to assign the string E13 which is obtained through
| i=13, j=5 (i and j are variables) to a variable called 'a'.
|
|
|


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Natarajan
 
Posts: n/a
Default splitting a concatenated string into separate rows

How can I use Excel to achieve the following



1) I wish to split a concatenated string into a column of separate characters



€œThisIsText€



should become..



€œt

h

i

s

i

s

t

e

x

t€.



2) After this I wish to display a predefined row beside every character



t €œxyz€ €œx1w€ €œ234.1w€

h €œsdf€ €œw21€ €œ12.5s€

i €œwer€ €œwe2€ €œ123.e€

..

..

..



Thank You



Natarajan Ganesan


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aling multiple sets of data by header column MarkusO Excel Discussion (Misc queries) 2 April 12th 06 07:29 PM
String parsing with variable lenght strings frosterrj Excel Worksheet Functions 10 March 31st 06 11:46 PM
Variable in string DevinC Excel Discussion (Misc queries) 5 January 26th 06 08:59 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


All times are GMT +1. The time now is 05:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"