Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBE syntax line question

How do I write the syntax in my macro using VBE to
perform this:
I need to create a variable named "OldStock" and set it
equal to the value of cell H2

Any help would be great. thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default VBE syntax line question

Dim OldStock

OldStock=Cells("H2").Value

Best,

RADO

"Colette" wrote in message
...
How do I write the syntax in my macro using VBE to
perform this:
I need to create a variable named "OldStock" and set it
equal to the value of cell H2

Any help would be great. thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VBE syntax line question

RADO,

I don't think you can use Cells in this way. You could use

OldStock = Cells(2,"H").Value

or

OldStock = Cells(2, ,8).Value

or

OldStock = Range("H2").Value

or even

OldSTock = Range("A1").Cells(2,"H").Value

or variations on the same, but not Cells("H2").


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RADO" wrote in message
...
Dim OldStock

OldStock=Cells("H2").Value

Best,

RADO

"Colette" wrote in message
...
How do I write the syntax in my macro using VBE to
perform this:
I need to create a variable named "OldStock" and set it
equal to the value of cell H2

Any help would be great. thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default VBE syntax line question

Oops. Thanks, Bob - I meant Range("H2")... Sorry.. programmed all night
long, can't think straight.
Best -

RADO


"Bob Phillips" wrote in message
...
RADO,

I don't think you can use Cells in this way. You could use

OldStock = Cells(2,"H").Value

or

OldStock = Cells(2, ,8).Value

or

OldStock = Range("H2").Value

or even

OldSTock = Range("A1").Cells(2,"H").Value

or variations on the same, but not Cells("H2").


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"RADO" wrote in message
...
Dim OldStock

OldStock=Cells("H2").Value

Best,

RADO

"Colette" wrote in message
...
How do I write the syntax in my macro using VBE to
perform this:
I need to create a variable named "OldStock" and set it
equal to the value of cell H2

Any help would be great. thanks







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
Syntax question BigDave63 Excel Worksheet Functions 4 February 5th 09 06:50 PM
VBA syntax question Matt Excel Discussion (Misc queries) 2 December 5th 07 03:08 PM
syntax question Giselle Excel Worksheet Functions 4 January 29th 06 01:59 AM
VBA Syntax Question? Michael168[_54_] Excel Programming 0 November 5th 03 11:02 AM
VBA Row(line) No Syntax? Michael168[_44_] Excel Programming 1 November 1st 03 05:36 AM


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

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

About Us

"It's about Microsoft Excel"