ColumnIndex

  • Thread starter Thread starter tpapaj
  • Start date Start date
T

tpapaj

Hi,

how can i get ColumnIndex of Activated Cell(by user)?

My problem is:

I have sheet, on sheet is button, user activate(click on) the cell
for example G5, then he push the button
The script must fill the cell A5(same row, first column) with curren
date...

To
 
Cell(Activecell.Column,"A")

points at that cell.

--

HTH

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

Range("A" & ActiveCell.Row).Value = Now

--
Jim Rech
Excel MVP
| Hi,
|
| how can i get ColumnIndex of Activated Cell(by user)?
|
| My problem is:
|
| I have sheet, on sheet is button, user activate(click on) the cell ,
| for example G5, then he push the button
| The script must fill the cell A5(same row, first column) with current
| date...
|
| Tom
|
|
| ---
| Message posted
|
 
I bet you meant:

Cells(ActiveCell.Row, "A")

Didn't you, Bob<g>

--
Jim Rech
Excel MVP
|
| Cell(Activecell.Column,"A")
|
| points at that cell.
|
| --
|
| HTH
|
| Bob Phillips
| ... looking out across Poole Harbour to the Purbecks
| (remove nothere from the email address if mailing direct)
|
| | > Hi,
| >
| > how can i get ColumnIndex of Activated Cell(by user)?
| >
| > My problem is:
| >
| > I have sheet, on sheet is button, user activate(click on) the cell ,
| > for example G5, then he push the button
| > The script must fill the cell A5(same row, first column) with current
| > date...
| >
| > Tom
| >
| >
| > ---
| > Message posted
| >
|
|
 
Or try . ..
Selection.End(xlToLeft).Select
ActiveCell.Formula = "=TODAY()"
 
Doh! My only excuse is that I saw through the OP's subject, but not all the
way.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Well, there's couple things to be aware of with your approach. One is that
it changes the active cell. You generally do not change the active cell
incidentally with a macro (unless you really want to).

The other thing is that the formula will not necessarily wind up in column
A. For example, if the active cell is G5 and there is an entry currently in
D5 (all other cells being empty) then the formula will go in D5, overwriting
what is there now.

--
Jim Rech
Excel MVP
| Or try . ..
| Selection.End(xlToLeft).Select
| ActiveCell.Formula = "=TODAY()"
|
|
| | > One way:
| >
| > Range("A" & ActiveCell.Row).Value = Now
| >
| > --
| > Jim Rech
| > Excel MVP
| > | > | Hi,
| > |
| > | how can i get ColumnIndex of Activated Cell(by user)?
| > |
| > | My problem is:
| > |
| > | I have sheet, on sheet is button, user activate(click on) the cell ,
| > | for example G5, then he push the button
| > | The script must fill the cell A5(same row, first column) with current
| > | date...
| > |
| > | Tom
| > |
| > |
| > | ---
| > | Message posted
| > |
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top