Setting ActiveCell address to an Absolute Reference

PedroVision

New Member
Joined
Oct 23, 2024
Messages
13
Office Version
  1. 2019
Platform
  1. Windows
The image shows the error message received when I tried to set the ActiveCell to an absolute value...the pop up suggest there is a way to set the address to an absolute cell...at this point in time, I can't see my way out of the weeds.

The following works to set the ActiveCell to a relative cell from the current ActiveCell...and...it works VERY nicely...

ActiveCell (3).Select...this works quite nicely as well...ActiveCell(3, 2).Select

My question...how can the ActiveCell be set to...(Row3,Column 2)???

Does anyone know if there is a definitive guide to the ActiveCell function???
 

Attachments

  • image_2024-10-26_093223032.png
    image_2024-10-26_093223032.png
    10.1 KB · Views: 3

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
.how can the ActiveCell be set to...(Row3,Column 2)???
VBA Code:
Sub Test()
  Cells(3, 2).Activate
End Sub

It should be noted though that it is extremely rare that you need to Select or Activate a particular cell or range to work with it. Also, selecting/activating can sometimes slow your vba code considerably.
What are you intending to do once that cell is activated?

guide to the ActiveCell function???
ActiveCell is not a function
 
Upvote 0
Solution
Try.
Cells(3, 2).Activate
Ahhhhhhhh...success is sweet...

Many thanks!!

I've developed a program to track a 2,000 line database...every once in a while I need to select a cell on the "mother" worksheet...Cells(3, 2).Activate will be quite useful...

In essence, I've written 3 columns of this main worksheet to a listbox, and developed methods to rapidly sort, and otherwise sift through the data...enabling the addition of new lines of data, using existing data with tweaks necessary to describe the new entry...

Code writing is a true blessing...and deeply satisfying. At any rate...THANK YOU for your expert help!

"I'll be back..."
 
Upvote 0
VBA Code:
Sub Test()
  Cells(3, 2).Activate
End Sub

It should be noted though that it is extremely rare that you need to Select or Activate a particular cell or range to work with it. Also, selecting/activating can sometimes slow your vba code considerably.
What are you intending to do once that cell is activated?


ActiveCell is not a function
I'll insert lines of data into my spreadsheet from a listbox...based on user specification, I'll insert the info, above or below the ActiveCell...sometimes I need to specify the NEW ActiveCell based on info gleaned from the listbox collated data...developing the VBA-based multi-page custom solution has been a wonderful experience...I love program development and application.
 
Upvote 0
Just the same, if you are moving the active cell with the code and then doing something in relation to that active cell (below/above/right etc) there is no need to actually move the active cell, the code can be written differently (& would be more efficient without the active cell movement). If you are interested in learning about coding more efficiently in this way then post a small section of your code where you are moving the active cell and then doing something in relation to that and we can take a look and make suggestions.
 
Upvote 0
I've also changed the highlight color to a light cyan...I want to see the ActiveCell, in order to visually verify where the new data is about to be placed. Anything I can do to increase my confidence is desirable.

My emphasis is to make my VBA program the main focus, with my worksheet acting as a reference and repository for the data...

That being said, I am more than certain my colleagues at MrEcel could very well snap my coding up a bit! (while I am a bit rusty after a 15 year hiatus (for one reason or another), my coding didn't completely evaporate into the ether...thank God). Examples to follow at a later date...
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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