Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default referencing Sheet from UserForm code

User types an "X" in a cell in Sheet!1, column AH.
This triggers code which will open Userform11.
On this Userform are two command buttons.
When CommandButton1 is selected, I need my code to reference the cell in
column F on same row as the "X" was input but I don't know how to get it to
do this as the code is in the Userform.
Thanks,
--
Traa Dy Liooar

Jock
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default referencing Sheet from UserForm code

You could declare a public variable in a General module (not in the userform,
not in the worksheet module).

Public MyRow as long

Then assign a value to that in your worksheet_change(???) event.
myrow = target.row

And use it in the code in your userform
msgbox activesheet.cells(myrow,"F").value





Jock wrote:

User types an "X" in a cell in Sheet!1, column AH.
This triggers code which will open Userform11.
On this Userform are two command buttons.
When CommandButton1 is selected, I need my code to reference the cell in
column F on same row as the "X" was input but I don't know how to get it to
do this as the code is in the Userform.
Thanks,
--
Traa Dy Liooar

Jock


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default referencing Sheet from UserForm code

If I understand your set up correctly, I think the cell reference you want
would be this...

Cells(ActiveCell.Row, "F")

So, if you had a Range variable that you wanted to set a reference back to
this cell...

Set MyRangeVariable = Cells(ActiveCell.Row, "F")

--
Rick (MVP - Excel)


"Jock" wrote in message
...
User types an "X" in a cell in Sheet!1, column AH.
This triggers code which will open Userform11.
On this Userform are two command buttons.
When CommandButton1 is selected, I need my code to reference the cell in
column F on same row as the "X" was input but I don't know how to get it
to
do this as the code is in the Userform.
Thanks,
--
Traa Dy Liooar

Jock


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default referencing Sheet from UserForm code

Rowcount = activecell.row
Range("F" & rowCount) = "abc"

"Jock" wrote:

User types an "X" in a cell in Sheet!1, column AH.
This triggers code which will open Userform11.
On this Userform are two command buttons.
When CommandButton1 is selected, I need my code to reference the cell in
column F on same row as the "X" was input but I don't know how to get it to
do this as the code is in the Userform.
Thanks,
--
Traa Dy Liooar

Jock

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
Referencing a UserForm Patrick C. Simonds Excel Programming 3 September 7th 09 04:36 AM
Referencing a UserForm in a Module Patrick C. Simonds Excel Programming 2 September 2nd 09 08:40 PM
userform code for timestamp on w/sheet TUNGANA KURMA RAJU Excel Programming 2 April 2nd 09 03:15 AM
Referencing Userform Controls JeremyJ Excel Programming 0 January 10th 09 12:43 AM
Referencing code outside of current sheet nemadrias Excel Programming 2 June 29th 06 08:26 PM


All times are GMT +1. The time now is 04:11 AM.

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

About Us

"It's about Microsoft Excel"