Posts by dodger7
-
-
-
-
Re: Autosort
if you place the following code behind the relevant sheet module it should work:
CodePrivate Sub Worksheet_Change(ByVal Target As Range) Range("B2:C43").Sort Key1:=Range("C2"), Order1:=xlAscending, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub
this is presuming your data has a header and you want to sort by score
-
Re: Name Based On Ranges In Another Table
you could paste this formula into "B2" and fill down
=IF(A2>'Condition Table'!$C$6,'Condition Table'!$A$6,(IF(Data!A2>'Condition Table'!$C$5,'Condition Table'!$A$6,(IF(Data!A2>'Condition Table'!$C$4,'Condition Table'!$A$5,IF(Data!A2>'Condition Table'!$C$3,'Condition Table'!$A$4,IF(Data!A2>'Condition Table'!$C$2,'Condition Table'!$A$3,'Condition Table'!$A$2)))))))[hr]*[/hr] Auto Merged Post Until 24 Hrs Passes;[dl]*[/dl]or do what Stephen said! easier
-
Hi Guys
wonder if anyone can help. I have a list of Staff ID's in column A (around 200)
im trying to launch an intranet site, enter the staff number into an input box and search.
Once the results appear, put the results into the cell next to the staff number (column B).
i realise this is very difficult to assist me with, since obviously you can only access an intranet site from within
the company but If I had to post the source code can someone point me in the right direction?Or am I trying to do the impossible?
Thanks in advance
Jamie
source code:
Code
Display More<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0081)http://corporate1.internal.standardlife.com/phoneline/Phnline.nsf/Search?OpenForm --> <HTML><HEAD><TITLE>Phone Line Search</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK href="Phone Line Search_files/contColour.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/contStyle.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/gblColour.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/gblStyle.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/siteNavColour.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/siteNavStyle.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/Grp_brand.css" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/pageExtraStyle.htm" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/pageCrossBrowserStyle.htm" type=text/css rel=stylesheet><LINK href="Phone Line Search_files/pageLine.htm" type=text/css rel=stylesheet> <SCRIPT language=Javascript src="Phone Line Search_files/pageGeneral.htm"></SCRIPT> <SCRIPT language=Javascript src="Phone Line Search_files/pageValidation.htm"></SCRIPT> <META http-equiv=Pragma content=no-cache> <META http-equiv=Cache-Control content=no-cache> <META http-equiv=expires content=-1> <SCRIPT language=JavaScript type=text/javascript> <!-- document.onkeydown=keyPress; function isFormValid(){ if (document.forms(0).txtQuerySurname.value.trim() == '' && document.forms(0).txtQueryForename.value.trim() == '' && document.forms(0).txtQueryPersonalID.value.trim() == '' && document.forms(0).txtQueryExtension.value.trim() == '' && document.forms(0).txtQueryDepartment.value.trim() == '' && document.forms(0).txtQueryDivision.value.trim() == '' && document.forms(0).txtQueryBuilding.value.trim() == '') { alert('Please enter something to search for.'); document.forms[0].txtQuerySurname.focus(); return(false); } else return(true); } function submitSearch() { if (isFormValid()) document.forms(0).submit(); } function keyPress() { var key=event.keyCode; if (key==13) { submitSearch(); } } // --> </SCRIPT> <SCRIPT language=JavaScript type=text/javascript> <!-- var SEARCH_FORM="Phone Line Search"; function PhonelineHelp() { strURL = "/" + strCurrentDB + "/" + "pageHelpMain?OpenPage"; //set features that will be on. Omitted features are off by default var strFeatures = 'toolbar,resizable,scrollbars,width=1000,height=600'; var objHelpWindow = window.open(strURL, 'PhonelineHelp', strFeatures); } function writeIntDirNav() { for (intIndex=0;intIndex<strIntDirTextArray.length;intIndex++) { var strID = "ssNav" + intIndex; var strMenuHTML = ""; strMenuHTML += "<tr><td class=\"fbtLeftNav0\" onMouseOver=\"this.className='fbtLeftNav0Over';"; strMenuHTML += strID + ".className='fbtLeftnavlink0Over'\" onMouseOut=\"this.className='fbtLeftNav0';"; strMenuHTML += strID + ".className='fbtLeftNavLink0'\" onClick=\"location.href=\'"; strMenuHTML += strIntDirURLsArray[intIndex] + "'\"><a href=\"" + strIntDirURLsArray[intIndex] + "\" class=\"fbtLeftNavLink0\" id=\""; strMenuHTML += strID + "\">" + strIntDirTextArray[intIndex] + "</a></td></tr>"; document.write(strMenuHTML); } } // --> </SCRIPT> <META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD> <BODY text=#000000 bgColor=#ffffff onload=document.forms[0].txtQuerySurname.focus();> <FORM name=_DominoForm action=/phoneline/Phnline.nsf/7c8ff6992778b3eb80256d800057b1c0!CreateDocument method=post> <SCRIPT language=Javascript> var strCurrentDB = "phoneline/Phnline.nsf"; var strIntDirTextArray=new Array(""); var strIntDirURLsArray=new Array(""); </SCRIPT> <!--Outer table to control layout of page--> <TABLE cellSpacing=0 cellPadding=0 width="100%" summary="This table controls the layout of the page" border=0> <TBODY> <TR> <TD> <TABLE class=fbtTopTable cellSpacing=0 cellPadding=0 summary="This table controls the layout of the top navigation" border=0> <TBODY> <TR class=fbtNavTable1Background> <TD> <TABLE class=fbtGlobalNavTable cellSpacing=0 cellPadding=0 summary="Application title" border=0> <TBODY> <TR> <TD class=fbtAppLogoArea> <SPAN class=fbtAppPHONE><I>phone</I></SPAN><SPAN class=fbtAppLINE>Line</SPAN></TD></TR></TBODY></TABLE></TD></TR> <TR class=fbtDivider> <TD> </TD></TR> <TR> <TD> <TABLE class=fbtTopTable cellSpacing=0 cellPadding=1 border=0> <TBODY> <TR> <TD class=fbtNav3Panel> <TABLE class=fbtPrintOnly cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 summary="This table controls the layout of the left hand navigation and main content" border=0> <TBODY> <TR> <TD class=fbtLeftColumn> <TABLE cellSpacing=0 cellPadding=0 width="100%" summary="This table contains the left column navigation" border=0><!------------------ Start of left hand navigation -------------------> <TBODY id=rowsearch style="DISPLAY: none"> <TR> <TD class=fbtLeftNav0 onmouseover="this.className='fbtLeftNav0Over';ssNavA.className='fbtLeftnavlink0Over'" onclick="location.href='/phoneline/Phnline.nsf/$$Search?OpenForm'" onmouseout="this.className='fbtLeftNav0';ssNavA.className='fbtLeftNavLink0'"><A class=fbtLeftNavLink0 id=ssNavA href="http://corporate1.internal.standardlife.com/phoneline/Phnline.nsf/$$Search?OpenForm">Another phoneLine search</A> </TD></TR></TBODY> <SCRIPT language=JavaScript>if(document.title != SEARCH_FORM) document.all.rowsearch.style.display="";</SCRIPT> <!------Links to Internal directories-------><!---End of links to Internal directories---> <TBODY> <TR> <TD class=fbtLeftNav0 onmouseover="this.className='fbtLeftNav0Over';ssNavB.className='fbtLeftnavlink0Over'" onclick="location.href='/theline/content1.nsf/viewAllDocsByID/BMKN-47WEQ6?OpenDocument'" onmouseout="this.className='fbtLeftNav0';ssNavB.className='fbtLeftNavLink0'"><A class=fbtLeftNavLink0 id=ssNavB href="http://corporate1.internal.standardlife.com/theline/content1.nsf/viewAllDocsByID/BMKN-47WEQ6?OpenDocument">The Line home page</A> </TD></TR></TBODY></TABLE><!------------------- End of left hand navigation --------------------></TD> <TD class=fbtMainColumn> <TABLE class=fbtMainContentTable cellSpacing=0 cellPadding=0 border=0><!-- MAIN CONTENT CELL START --> <TBODY> <TR> <TD class=fbtMainContent><!-- START OF CONTENT --><SPAN class=fbtContent><A name=pagebody></A> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><A cellpadding="0" cellspacing="0" border="0"> <TBODY> <TR vAlign=top> <TD class=sectionHead width=200><A width="225">Search phoneLine</A></TD> <TD class=sectionHead><A width="416"> <DIV align=right><A class=globalNav title="launch phoneline help" href="javascript:PhonelineHelp();">Help</A> </DIV></TD></TR> <TR vAlign=top> <TD width=641 colSpan=2><BR class=tinyFont></TD></TR> <TR vAlign=top> <TD class=smallSize width=641 colSpan=2>Your search can be made up from one of, or any combination of, the following fields:</TD></TR></TBODY></TABLE><BR> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0></A><A cellpadding="0" cellspacing="0" border="0"> <TBODY> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=surname>Surname:</LABEL></A></TD> <TD><A width="416"><INPUT id=surname size=30 name=txtQuerySurname> </LABEL></A></TD></TR> <TR vAlign=top> <TD width=250><A width="225"><BR></A></TD> <TD><A width="416"><IMG height=1 alt="" src="Phone Line Search_files/ecblank.gif" width=1 border=0></A></TD></TR> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=forename>Forename:</LABEL></A></TD> <TD><A width="416"><INPUT class=clsInput id=forename size=30 name=txtQueryForename> </LABEL></A></TD></TR> <TR vAlign=top> <TD width=250><A width="225"><BR></A></TD> <TD><A width="416"><IMG height=1 alt="" src="Phone Line Search_files/ecblank.gif" width=1 border=0></A></TD></TR> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=staffid>Staff ID:</LABEL></A></TD> <TD width=416><INPUT class=clsInput id=staffid size=30 name=txtQueryPersonalID> </LABEL></TD></TR> <TR vAlign=top> <TD width=250><A width="225"><BR></A></TD> <TD width=416><IMG height=1 alt="" src="Phone Line Search_files/ecblank.gif" width=1 border=0></TD></TR> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=extension>Extension:</LABEL></A></TD> <TD><A width="416"><INPUT class=clsInput id=extension size=30 name=txtQueryExtension> </LABEL></A></TD></TR> <TR vAlign=top> <TD width=250><A width="225"><BR></A></TD> <TD><A width="416"><IMG height=1 alt="" src="Phone Line Search_files/ecblank.gif" width=1 border=0></A></TD></TR> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=department>Department:</LABEL></A></TD> <TD><A width="416"><INPUT class=clsInput id=department size=30 name=txtQueryDepartment> </LABEL></A></TD></TR> <TR vAlign=top> <TD width=250><A width="225"><BR></A></TD> <TD><A width="416"><IMG height=1 alt="" src="Phone Line Search_files/ecblank.gif" width=1 border=0></A></TD></TR> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=division>Division/Operating company:</LABEL></A></TD> <TD><A width="416"><INPUT class=clsInput id=division size=30 name=txtQueryDivision> </LABEL></A></TD></TR> <TR vAlign=top> <TD width=250><A width="225"><BR></A></TD> <TD><A width="416"><IMG height=1 alt="" src="Phone Line Search_files/ecblank.gif" width=1 border=0></A></TD></TR> <TR vAlign=top> <TD class=labelText width=250><A width="225"><LABEL for=building>Building:</LABEL></A></TD> <TD><A width="416"><INPUT class=clsInput id=building size=30 name=txtQueryBuilding> </LABEL></A></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0></A><A cellpadding="0" cellspacing="0" border="0"> <TBODY> <TR vAlign=top> <TD><A width="641"> <HR SIZE=1> <DIV align=right><INPUT class=psButton onclick=submitSearch() type=button value=Find> </DIV></A></TD></TR> <TR vAlign=top> <TD class=labelText><A width="641">For external phone numbers try <A title="Link to BT Directory Enquiries" href="http://www.bt.com/directory-enquiries/dq_home.jsp">BT Directory Enquiries</A></TD></TR></TBODY></TABLE></SPAN><!-- END OF CONTENT --></A></TD></TR><!-- MAIN CONTENT CELL END --></TBODY></TABLE></TD> <TD class=fbtRightColumn><BR class=fbtTiny><!-----Contextual "help" table------> <TABLE width="100%" border=0> <TBODY> <TR> <TD class=fbtTabRow align=left witdh="100%"></TD></TR></TBODY></TABLE><!--End of Contextual "help" table--></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <P><!-- <input type="submit" value="Ignore me">--> <META http-equiv=Pragma content=no-cache> <META http-equiv=expires content=-1><BR><BR><BR></FORM></P></BODY></HTML>
-
-
-
Re: Reference To Book With Variable Name
you could do it in VBA by inserting the following routine:
Code
Display MoreSub example() Dim weekno As Integer Dim wbname As String weekno = Sheet1.Range("A1").Value wbname = "week" & weekno Sheet1.Range("A3").Value = "=[" & wbname & ".xls]sheet1!A1" End Sub
then place the routine behind a button.
I have uploaded an example, as theres a few presumptions (sheet names, cell refereces etc)
HTH -
Re: Dynamically Adding Controls To User Form
if you can upload an example i can have a look
-
Re: Dynamically Adding Controls To User Form
strange, it works with me. let me have another look
-
Re: Incrementing A Numeric Character Containing Alphanumeric Data.
put ticket numbers where? just listed in a column, from 1/300 to 300/300?
-
Re: Dynamically Adding Controls To User Form
if you change
to
and add a caption:
Code
Display MoreWith ctl1 .Visible = True .caption = "Hello World" .Width = 75.75 .Height = 16.5 .Left = 6 .Top = Me.Height - 50 .Name = "NewProdlbl" .Default = True '.Object = "Label.1" .SetFocus End With
Then it should work.
HTH
-
Re: Filtering By Vba
also, when you are creating a new thread the rules clearly state you put what your problem is, not what you think the solution to be. Some people who know many formulas but not VBA would probably avoid looking at your thread, when vba is not necessary.
HTH in future
-
Re: Creating A Random Button
Hi Tony
Yes the #NAME? error means that you will need to install the analysis toolpak. unfortunately there is no way round this (for randbetween anyway)
Im sure there is probably a way to do it using just rand() that maybe someone else can maybe help you with.
Are you sure you cant just go to tools>add-ins and check the analysis toolpak box?Jamie
-
Re: Creating A Random Button
you can create a button and assign the following macro:
CodeSub Button1_Click() Sheet1.Range("E15").Value = "=INDEX($A:$C,RANDBETWEEN(1,COUNTA($A2:$A65536)),RANDBETWEEN(1,3))" End Sub
where "E15" being the cell you wish to display the random value, and "A:C" within the formula being the range of columns you wish to search for the random value.
Please note you will require the analysis Toolpak add-in to be installed for the "randbetween" function to work.
see http://www.ozgrid.com/Excel/excel-random-pick.htm for more info (this was the first result when I searched "random cell")
HTH
-
-
Re: Macro Button To Fill In Table
Hi
ive uploaded an example that you should be able to follow by looking at the code.
HTH
-
Re: Userform Mouse Keyboard
my partner finds it useful aswell, being pregnant and having problems with swolen wrists, carpel tunnel syndrome etc, so thanks
-
Re: Vlookup Multiple Columns In Different Workbooks
presuming that "jack" is on A2 of sheet 1, workbook 1, you can put this formula in B2:
=IF(VLOOKUP(A2,'[workbook 2.xls]Sheet1'!$A$2:$D$7,2,FALSE)>0,VLOOKUP(A2,'[workbook 2.xls]Sheet1'!$A$2:$D$7,2,FALSE),(IF(VLOOKUP(A2,'[workbook 2.xls]Sheet1'!$A$2:$D$7,3,FALSE)>0,VLOOKUP(A2,'[workbook 2.xls]Sheet1'!$A$2:$D$7,3,FALSE),VLOOKUP(A2,'[workbook 2.xls]Sheet1'!$A$2:$D$7,4,FALSE))))
You can then copy the formula down the column. you will need to change the name of the workbooks, range etc.
Note this will only work if theres only one number for each person. It appears your data could be better laid out. See Dave's thread on efficient spreadsheet design:http://www.ozgrid.com/Excel/ExcelSpreadsheetDesign.htm
HTH
Jamie