ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change it to a variable (https://www.excelbanter.com/excel-programming/428628-change-variable.html)

alvin Kuiper

Change it to a variable
 
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


joel

Change it to a variable
 
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


Paul C

Change it to a variable
 
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


Mike H

Change it to a variable
 
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


Roger Govier[_3_]

Change it to a variable
 
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" wrote in message
...
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


Jacob Skaria

Change it to a variable
 
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


alvin Kuiper

Change it to a variable
 
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


Jacob Skaria

Change it to a variable
 
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



All times are GMT +1. The time now is 02:01 PM.

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