Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm currently working on referencing a cell in anther sheet which
contins the value I need for comparison. In other words, Cell A1 on Sheet 1 is equal to Sheet 2, Cell A15. In my VBA code, I am needing to refer to Cell A1 of Sheet 1 to find the value of the cell to which it refers. Is this possible? Thanks Louis |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If Sheet1 cell A1 contains:
=Sheet2!A15 then in VBA Sub qwerty() x = Sheets("Sheet1").Range("A1").Value MsgBox (x) End Sub will display the value in Sheet1 cell A1 (which is also the value in Sheet2 cell A15) -- Gary''s Student - gsnu200728 "ll" wrote: I'm currently working on referencing a cell in anther sheet which contins the value I need for comparison. In other words, Cell A1 on Sheet 1 is equal to Sheet 2, Cell A15. In my VBA code, I am needing to refer to Cell A1 of Sheet 1 to find the value of the cell to which it refers. Is this possible? Thanks Louis |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worksheets("Sheet1").Range("A1").Value
"ll" wrote: I'm currently working on referencing a cell in anther sheet which contins the value I need for comparison. In other words, Cell A1 on Sheet 1 is equal to Sheet 2, Cell A15. In my VBA code, I am needing to refer to Cell A1 of Sheet 1 to find the value of the cell to which it refers. Is this possible? Thanks Louis |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 11, 2:31 pm, JMB wrote:
Worksheets("Sheet1").Range("A1").Value "ll" wrote: I'm currently working on referencing a cell in anther sheet which contins the value I need for comparison. In other words, Cell A1 on Sheet 1 is equal to Sheet 2, Cell A15. In my VBA code, I am needing to refer to Cell A1 of Sheet 1 to find the value of the cell to which it refers. Is this possible? Thanks Louis Thanks for your help. Here is what I have so far. This is code in a UserForm and I am wanting it to look at values on the active worksheet and compare them with a textbox value (as in the code). The value is not getting put into the cell in the timesheet, and my test msgbox comes back blank as well. Thanks for any help you can provide. - Louis ----------------------------------------------------------- Private Sub CmdEnter_Click() Dim a As Integer Dim b As Integer Dim testFromCell As String For a = 9 To 300 If Worksheets("Hourly Timesheets").Cells(a, 1).Value = TextBox2.Value Then Worksheets("Hourly Timesheets").Cells(a, b).Select Worksheets("Hourly Timesheets").Cells(a, b).Value = TextBox1.Value testFromCell = worksheets("Hourly Timesheets").Cells(a, b).Value End If Next a Unload Me MsgBox testFromCell End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is b and where is it set??
-- Gary''s Student - gsnu200728 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 11, 7:09 pm, Gary''s Student
wrote: What is b and where is it set?? -- Gary''s Student - gsnu200728 Oops - here's the missing code - b is set to the ListIndex of the combo box: b = Me.CboLeaveType2.ListIndex |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 12, 8:18 am, ll wrote:
On Jun 11, 7:09 pm, Gary''s Student wrote: What is b and where is it set?? -- Gary''s Student - gsnu200728 Oops - here's the missing code - b is set to the ListIndex of the combo box: b = Me.CboLeaveType2.ListIndex The odd thing is that I can have text (i.e. "car 4") on sheet2 and have a cell in sheet1 reference it, but when I try doing a date from sheet2 (or sheet1) and comparing it to the date in my textbox, the code runs without error but produces no result. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing Cell Next To Today's Date Cell | Excel Discussion (Misc queries) | |||
Obtain Cell Formatting in Cell Referencing? | Excel Programming | |||
Referencing a cell based on the value in another cell | Excel Discussion (Misc queries) | |||
Cell Referencing | Excel Programming | |||
Cell Referencing | Excel Programming |