Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
Say i have
Dim Current Dim Last and i had a cell with a number, how do i set Current to be equal tha that value. isnt it:- Current = Range("H1") or am i just being a noob Thank -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
If your "H1" is on the ActiveSheet, yes. But it's always better to
explicitly indicate which sheet. -- Kind Regards, Niek Otten Microsoft MVP - Excel "mushy_peas " wrote in message ... Say i have Dim Current Dim Last and i had a cell with a number, how do i set Current to be equal that that value. isnt it:- Current = Range("H1") or am i just being a noob Thanks --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
well i used
Sheets("Till").Select so i was on the right sheet. but it doesn work :O -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
Try this
Dim last as integer, next as integer Sub findRow() last = application.worksheetfunction.counta(RAnge("A:A")) next= last + 1 and the rest of your code here.. End sub Regards Peter -----Original Message----- Say i have Dim Current Dim Last and i had a cell with a number, how do i set Current to be equal that that value. isnt it:- Current = Range("H1") or am i just being a noob Thanks --- Message posted from http://www.ExcelForum.com/ . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
Sub Testcurrent()
Dim current as variant, current1 as Variant Dim rng a range set rng = worksheets("Till").Range("H1") current = worksheets("Till").Range("H1").Value current1 = rng.Value msgbox Current & " - " & Worksheets("Till").Range("H1").value & _ vbNewline & Current1 & " - " & rng.Value & vbNewline & _ rng.Address(external:=True) End sub -- Regards, Tom Ogilvy mushy_peas wrote in message ... well i used Sheets("Till").Select so i was on the right sheet. but it doesn work :O( --- Message posted from http://www.ExcelForum.com/ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
i dont get this bit
application.worksheetfunction.counta(RAnge("A:A")) could you pls explain, ta --- Message posted from http://www.ExcelForum.com/ |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
It will tell you how many cells in column A are not empty. (it counts how
many are no empty - it is using the excel worksheet function COUNTA as in =COUNTA(A:A) -- Regards, Tom Ogilvy mushy_peas wrote in message ... i dont get this bit application.worksheetfunction.counta(RAnge("A:A")) could you pls explain, ta --- Message posted from http://www.ExcelForum.com/ |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
Thank You, Thank You!
Dim rng a range set rng = worksheets("Till").Range("H1") current = worksheets("Till").Range("H1").Value It all works fine now. but why do i need "set rng worksheets("Till").Range("H1")" and can you just have "rng = worksheets("Till").Range("H1")". wots th dif -- Message posted from http://www.ExcelForum.com |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
DIM is what i am
Demonstrating several concepts for you. Use what you need.
it is sometime useful (less typing) to set a range reference (a variable that holds a reference to a range object) to a cell or range. then you can use this variable. this is especially true if you are working between two workbooks. -- Regards, Tom Ogilvy mushy_peas wrote in message ... Thank You, Thank You! Dim rng a range set rng = worksheets("Till").Range("H1") current = worksheets("Till").Range("H1").Value It all works fine now. but why do i need "set rng = worksheets("Till").Range("H1")" and can you just have "rng = worksheets("Till").Range("H1")". wots the diff --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|