Refer To Objects In Other Forms
Mar 13, 2007
I'm trying to refer to a togglebutton in a form from a command button in a different form.
Right now I have
Private Sub CommandButton1_Click()
If ToggleButton1.Value = True Then
Pickers.Hide
EndRun.Show
Else
Pickers.Hide
Runinfo1.Show
End If
End Sub
but I assume I have to preceed the Togglebutton1 with the name of the form that it is in but I am not sure how.
I don't even know if the above code will work as obviously I haven't got that far yet...it may be completely off...
View 3 Replies
ADVERTISEMENT
Dec 27, 2013
So I'm creating a grid worksheet for engineering calculations and I have a couple questions about the best way to do it. I've been messing with excel for my calcs for about a decade now, and I every once in a while I try and improve them.
First: I will have several input areas that will either be colored text or shaded background (either works for me). I don't want these 'input required' objects to print as color, just black. But I want my logo at the sheet top to print as color. I've only found ways to not print any color. Can I print the logo as color and the 'input required' stuff as black?
Second: When I do calcs by hand, I write them out on 10x10 grid paper. Each 10x10 grid is one inch. In the past I've created this grid out of the cells, which works. I frequently need to change formulas around though, and each time I do this, I end up needing to mess with the grid cells also. Is there a way to create the grid and have it in the background so it doesn't need to be adjusted each time I change formulas? I wan't the grids to print, and also want to see them on the screen, as I sometimes draw simple objects along with the formulas.
View 9 Replies
View Related
Jun 18, 2009
In Excel, I want VBA to refer to the SENT ITEMS folder in Outlook. I want to loop over all sent items, and if the email address satisfies a condition, then record that fact in Excel. I am good at VBA in Excel, and I have a passing knowledge of VBA in Outlook, but I don't know how to refer to Outlook within my Excel VBA.
View 2 Replies
View Related
Sep 14, 2009
How do I refer to a combo box (form control) in a calculation. EG: how can i say if comboBox = Something then ....
View 5 Replies
View Related
Nov 9, 2009
I'm using this code to open another workbook:
Dim FileToOpen
FileToOpen = Application.GetOpenFilename _
(Title:="Please locate BlankSAMSRegister.xlsm", _
FileFilter:="BlankSAMSRegister.xlsm (*.xlsm),")
If FileToOpen = False Then
MsgBox "No file specified.", vbExclamation, "Error"
Exit Sub
End If
Once this second workbook is open, how do I refer to each one within the subsequent code?
I really need the parent workbook to be named as wb1 and the child to be names wb2 so I can flick between the two in the next macro... I can get the parent using thisworkbook.name, but how do I get the child?
View 9 Replies
View Related
May 10, 2007
I have a check box whithin a worksheet. This CheckBox doesn't have any linked cell, and doesn't have any macro asigned. know I would like to refer to the value of the checkbox by vba kind of: ?ActiveSheet.Shapes("CheckBox1").value=true 'from the vba's inmediate window
View 4 Replies
View Related
May 9, 2014
I have multiple sheets as Name1 ; Name2 ; Name3 and each sheet have a value on cell A1 for any number let say between 0 to 100. On another sheet call SheetName, I have A1=Name1 ; A2=Name2 ; A3=Name3.
I have formula as:
[Code] .....
The INDIRECT formula work to refer each cell A1 in each sheet, however if the sheet name include a space then it won't work anymore. How to make it work with the sheet name with space?
View 5 Replies
View Related
Mar 9, 2009
The summary page summarises the source data into how much revenue each department has made over 12 months.
However the formula in Summary worksheet column B will only total up the amounts if the month in the Source worksheet column B is the 1st of the month. How do I change the formula in Summary worksheet column B to purely go by month and ignore the day?
View 4 Replies
View Related
Jul 17, 2009
The "summary" tab will be calculating 20 statistics for each of the 30 or more tabs. In an effort to automate this - can I replace writing "January!" with a cell reference? For example;
instead of writing = sum(january!a:a). Could I write = sum("A1"a:a), with the A1 Cell = january!. Obviously I tried this and it does not work but I am not sure if there are other options.
View 2 Replies
View Related
Jul 20, 2009
Let's say I have a formula in cell A1 that is =COLUMN(L5). So cell A1 returns the result 12 (for column L).
I now want to create an index formula in another cell:
=INDEX(C1:C12, ........), but I want the 12 in C12 to be picked up from the result of cell A1
So, I tried various things like =INDEX(C1:C&INDIRECT(A1)....etc but I can't work out the correct way of doing this.
View 6 Replies
View Related
Nov 24, 2009
I've got a workbook that increments in sheets for each new week. I have a cell showing the current week number for that sheet ( lets say cell C1) and any formulas that need to reference data from the previous sheet do in 'indirect' function which basically looks at the current week number ( lets say week 20)in cell C1 and minus's 1 to navigate to the previous week (week 19).
I was wondering if there was a way to reference the previous sheet purely by the order they're in.
So say i have 5 sheets named "1,4,5,8,9" and these represent week numbers so the sheet named '8' in cell C1 would have '8' standanding for the week number but cells that wanted to reference the previous sheet couldn't do the 'indirect' C1-1 as there is no 'week 7'.
The weeks used could vary alot so a formula to reference the directly previous sheet is needed.
ok, thought best if i show you the actual formula
=IF(ISBLANK(C12),"",IF(ISERROR(VLOOKUP(C12,INDIRECT("'"&($AG$2-1)&"'!$C:$AG"),28,FALSE)),G12,SUM(G12,VLOOKUP(C12,INDIRECT("'"&($AG$2-1)&"'!$C:$AG"),28,FALSE))))
the '$A$G2-1' part is the bit that redirects to the previous sheet based on it's name, what i think i really need is to replace this part with a 'PrevSheet' function but i'm unsure how.
View 11 Replies
View Related
Apr 3, 2014
Is it possible to refer to an object which is in another subroutine?
Or should i have to give its definition in each sub i need it?
View 7 Replies
View Related
Nov 3, 2008
I'm trying to do is add a signature box (for inventory-taking accountability) directly below the pasted area after I paste it. Now, of course, the copied and pasted area could have 5 rows or it could have 15, and when I copy it from the first sheet and paste it into the second it doesn't preserve the name of the range on the second page, so what I really need to do to add the signature box directly below the last row in the pasted area is specify the location in relation to the last row in the pasted selection, but I don't know how to do that. Using ActiveCell always refers to the top-left-most cell in the selected area. So...
If I have an area selected, how do I refer to the bottom-right-most cell in that selection (in the same way that ActiveCell refers to the top-left-most cell)? Or at least the bottom row? Or, even better, the row below the bottom row?
View 2 Replies
View Related
Nov 20, 2009
=COUNTIF(A2&"_RES","Yes")
A2 refers to a linked cell but I have tried without the link there still no joy. Together they would generate for example "DCA_RES" which would refer to a column range in a different sheet on the same workbook.
I want this to work so that I can implement more easily new lines to refer to different sheets. (Drag to copy) instead of having to copy and edit a formula 100 times.
View 6 Replies
View Related
Oct 26, 2009
I'm trying to call a function that is stored in a cell as a text string. In cell A1, I have the text Sum('Sheet1:Sheet3'!C3). I want to call this function from a different cell. Is this possible using the pre-defined functions, or would I be better creating my own function?
View 4 Replies
View Related
Aug 31, 2012
I have a selection that I am going through with a 'for each' and then performing actions if the cells meet a certain criteria. I have been referencing nearby cells with the offset function, but now my sheet is too big and I need to change the code often and the offset function is difficult, is there anyway to refer to cells without the offset function, preferably by column letter
PHP Code:
For Each Cel in SelectionIf Cel = x Thenvalue1 = Cel.Offset(0,39).Valuevalue2 = Cel.Offset(0,5).ValueEnd IfNext Cel
View 9 Replies
View Related
Nov 7, 2013
with the below code i want the highlighted in red (RC11) to refer to last column and last row.
Code:
Sub try ()
Dim finalrow As Long
Dim finalcol As Long
Set wspo = Worksheets("Previous Order")
wspo.Select
finalrow = wspo.Cells(Rows.Count, 1).End(xlUp).Row
finalcol = wspo.Cells(1, Columns.Count).End(xlToLeft).Column
[code]...
View 2 Replies
View Related
Jun 9, 2006
When I look in VBA under the Microsoft Excel Objects at the sheet names in my workbook I see two names for the same sheet like so:
sOrdersFB(Orders From Bob)
how to select using the first name sOrdersFB?
View 9 Replies
View Related
Dec 7, 2006
In my current spreadsheet I use Offset to change the values of various cells. The problem is that if I make any changes to the columns it throws the whole offset thing off. So, instead of using offset to paste all the data is there an alternative that would work better?
I was thinking maybe I could name a column as a range and then have the cell in that row equal a value.
What solutions are there?
ActiveCell = TextBox1.Value
ActiveCell.Offset(0, 1) = TextBox2.Value
ActiveCell.Offset(0, 2) = ComboBox9.Value
ActiveCell.Offset(0, 3) = ComboBox2.Value
ActiveCell.Offset(0, 4) = ComboBox3.Value
ActiveCell.Offset(0, 5) = ComboBox11.Value
ActiveCell.Offset(0, 12) = ComboBox1.Value
ActiveCell.Offset(0, 13) = TextBox6.Value / 100
ActiveCell.Offset(0, 16) = TextBox4.Value
ActiveCell.Offset(0, 17) = TextBox5.Value
ActiveCell.Offset(0, 18) = CostBasis
ActiveCell.Offset(0, 19) = NumberOfShares
ActiveCell.Offset(0, 59) = DividendFreq
View 9 Replies
View Related
Oct 1, 2007
I created a name in Excel 2002, Name = "NameToUse", Refers to = "Bill".
How do I get the value in VBA code?
Range("NameToUse").value ' doesnt work
NameToUse ' doesn't work
View 3 Replies
View Related
Jul 15, 2008
I want to use VBA to update a drawing object's color, such as a circle.
For example, pretend I am counting sheep and I need to know when I have reached the maximum count by the visual aide of a stoplight. The script in my head reads: If the max. count of the sheep is less than 5, then the stoplight is green. If the max. count of the sheep is equal to 5, then the stoplight is yellow. If the max. count of the sheep is greater than 5, then the stoplight is red.
Is there a way to do such a thing on excel and with VBA?
View 9 Replies
View Related
Jun 29, 2006
I created four Ranges called "Range1", "Range2", "Range3" and "Range4", and wrote short program, that fills them:
Dim i As Integer
For i = 1 To 4
Range("Range" & i).value = 1
Next i
Is it possible to do similiar thing with for example ComboBox?
Let's say that i have comboBoxes named "cb1", "cb2", "cb3" and "cb4" and want to disable them.
View 9 Replies
View Related
Jan 26, 2007
I ran into some difficulties by calling an object's function from a collection.
'BondIndex Class Module
Option Explicit
Private m_BondReturn As Collection
Public Sub Initialize()
Set m_BondReturn = New Collection
End Sub
Public Sub Load(BondPoints As Integer)
Dim i As Integer
Initialize
'Load Parameters of Bond
End Sub
Property Get BondReturn() As Collection
Set BondReturn = m_BondReturn
End Property................................
View 2 Replies
View Related
Mar 22, 2007
If I hadn't read it on here, how would I have know that they existed? They are not mentioned in the standard Excel help files (not that I could see anyway).
What other "objects" are available? I had a look through the references in the VBE and there are literally hundreds on items which all look pretty "juicy". Does that mean there are a whole host of other objects that I could use in my Excel spreadsheets to either make them simplier or more powerful?
If so, where does one find any reference info on them?
View 3 Replies
View Related
Dec 21, 2007
Why should I set objects to nothing (ie clear them) just before ending a sub routine? Doesn't excel dump the variables after the sub is finished running?
Example:
Dim ws As worksheet
Then at the end...
Set ws = Nothing
View 3 Replies
View Related
Dec 13, 2009
I have a workschedule in excel.
It has a tab for every week in a year so 52 in total. The first tab is supposed to give some general information. I have a few questions on how to implement things.
1 i wanna be able to view the Total amount hours worked in my current week.
I calculate the current workweek using:
View 6 Replies
View Related
Dec 31, 2013
In conditional formatting, which formula do I use to refer to another cell? Trying
=(ISBLANK(K1))
without luck.
View 9 Replies
View Related
Jul 15, 2014
I have a userform with a ListBox and I'm trying to refer to each particular item in the Listbox for a range but it doesn't work.
[Code] .....
View 14 Replies
View Related
Apr 17, 2009
I want to be able to safeguard against a user changing the name of a worksheet, so I use the sheet's codename in all my macros.
I have the codename of a sheet: shOptions
From a different workbook, "ActiveWorkbook.shOptions" doesn't work. How can I use "shOptions" in the other workbook.
View 14 Replies
View Related
Nov 12, 2005
I have twelve sheets in the book called "Jan", "Feb" to "Dec". Now I will use value in the two sheets by this format:
Row1 will contain columns, "jan", "feb", and etc.
Row2 should be like "=JAN!b2", "=FEB!b2", etc till "=Dec!b2".
Now the question is, how can I use reference, but not directly put in the sheetname such as "Jan!b2"?
In another word, what I want to use is like "=Worksheets(cells(...))!b2".
View 11 Replies
View Related