PC Review


Reply
Thread Tools Rate Thread

Change it to a variable

 
 
alvin Kuiper
Guest
Posts: n/a
 
      18th May 2009
HI
i have this code:
Range("perioder!$H$" & start).Value
where start is a variable
now i also want to change $h$ to a variable
but i Can't make it right
Help
Alvin

 
Reply With Quote
 
 
 
 
joel
Guest
Posts: n/a
 
      18th May 2009
Where c col is a number 1..256.

Sheets("perioder").cells(start,Col).Value


"alvin Kuiper" wrote:

> HI
> i have this code:
> Range("perioder!$H$" & start).Value
> where start is a variable
> now i also want to change $h$ to a variable
> but i Can't make it right
> Help
> Alvin
>

 
Reply With Quote
 
Paul C
Guest
Posts: n/a
 
      18th May 2009
Try using the cells command instead, it is much easier to call both a row and
column. The column does have to be a number reference.

Sheets("perioder").Cells (start,column number).value
--
If this helps, please remember to click yes.


"alvin Kuiper" wrote:

> HI
> i have this code:
> Range("perioder!$H$" & start).Value
> where start is a variable
> now i also want to change $h$ to a variable
> but i Can't make it right
> Help
> Alvin
>

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      18th May 2009
Try this

Dim MyCell As String
Dim Start As Long
MyCell = "H"
Start = 1
x = Range("perioder!" & MyCell & Start).Value

Mike

"alvin Kuiper" wrote:

> HI
> i have this code:
> Range("perioder!$H$" & start).Value
> where start is a variable
> now i also want to change $h$ to a variable
> but i Can't make it right
> Help
> Alvin
>

 
Reply With Quote
 
Roger Govier
Guest
Posts: n/a
 
      18th May 2009
Hi Alvin

One way, with colno as the variable holding the column number required (8),
then
sheets("perioder").cells(start , colno).Value

--
Regards
Roger Govier

"alvin Kuiper" <(E-Mail Removed)> wrote in message
news:0FF67427-3FDB-42DE-9E36-(E-Mail Removed)...
> HI
> i have this code:
> Range("perioder!$H$" & start).Value
> where start is a variable
> now i also want to change $h$ to a variable
> but i Can't make it right
> Help
> Alvin
>

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      18th May 2009
Sheets("perioder").Cells(start,8).value

OR

strCol = "H"
Range("perioder!" & strCol & start).Value

OR

strCol = "H"

Sheets("perioder").cells(start,strCol).Value

--
If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

> HI
> i have this code:
> Range("perioder!$H$" & start).Value
> where start is a variable
> now i also want to change $h$ to a variable
> but i Can't make it right
> Help
> Alvin
>

 
Reply With Quote
 
alvin Kuiper
Guest
Posts: n/a
 
      18th May 2009
Thanks to all

And Jacob I give a beer if you ever come to denmark
Just write
Alvin


"Jacob Skaria" skrev:

> Sheets("perioder").Cells(start,8).value
>
> OR
>
> strCol = "H"
> Range("perioder!" & strCol & start).Value
>
> OR
>
> strCol = "H"
>
> Sheets("perioder").cells(start,strCol).Value
>
> --
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "alvin Kuiper" wrote:
>
> > HI
> > i have this code:
> > Range("perioder!$H$" & start).Value
> > where start is a variable
> > now i also want to change $h$ to a variable
> > but i Can't make it right
> > Help
> > Alvin
> >

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      18th May 2009
Thanks Alvin for the feedback and offer..

If this post helps click Yes
---------------
Jacob Skaria


"alvin Kuiper" wrote:

> Thanks to all
>
> And Jacob I give a beer if you ever come to denmark
> Just write
> Alvin
>
>
> "Jacob Skaria" skrev:
>
> > Sheets("perioder").Cells(start,8).value
> >
> > OR
> >
> > strCol = "H"
> > Range("perioder!" & strCol & start).Value
> >
> > OR
> >
> > strCol = "H"
> >
> > Sheets("perioder").cells(start,strCol).Value
> >
> > --
> > If this post helps click Yes
> > ---------------
> > Jacob Skaria
> >
> >
> > "alvin Kuiper" wrote:
> >
> > > HI
> > > i have this code:
> > > Range("perioder!$H$" & start).Value
> > > where start is a variable
> > > now i also want to change $h$ to a variable
> > > but i Can't make it right
> > > Help
> > > Alvin
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
? value input of one variable change options on second variable? =?Utf-8?B?VGVkRHVzaGFuZQ==?= Microsoft Access Form Coding 1 7th May 2005 05:43 AM
change of one variable changes another Greg Green Microsoft Access Form Coding 2 18th Nov 2004 04:52 PM
change value of a variable =?Utf-8?B?Sm9zZW1h?= Microsoft C# .NET 1 13th Oct 2004 04:53 PM
Change name of variable Arjen Microsoft C# .NET 2 23rd May 2004 05:36 AM
change in Variable Value Varadha Microsoft VC .NET 1 25th Sep 2003 03:21 PM


Features
 

Advertising
 

Newsgroups
 


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