Set variable to ActiveCell

mjpst6

New Member
Joined
Jan 28, 2005
Messages
15
Re: Cell value to VB variable

Is there a way to set the active cell value as the variable value instead of specifying which cell.

I already have the active cell part down but don't know the code to make it the variable value. :oops:

Thanks in advance for any help
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Re: Cell value to VB variable

Thanks Hotpepper,

My dumb mistake was I forgot that text was String so I had what you said to have but had the definition wrong.

Thanks for the help nonetheless,
 
Upvote 0
Hi,

Unless some specific reason, it's generally and usually a good habit to stay away from using ActiveCell or Selection, in Standard Routines anyway. There's not much need to select cells or activate them in procedures. They have their benefits, but not usually. If you want to post your code an a representative sample, an improved solution may present itself.
 
Upvote 0

Forum statistics

Threads
1,207,443
Messages
6,078,589
Members
446,350
Latest member
FrancieRech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top