Re: Fill ComboBox With Only 1 Occurence Of Each Item
Thanks all,
I have to admit I never thought about doing it that way.
Thanks
Naf
Re: Fill ComboBox With Only 1 Occurence Of Each Item
Thanks all,
I have to admit I never thought about doing it that way.
Thanks
Naf
Hello all,
I'm not sure if this is possible or not but I think you guys and girls will be able to help me.
The ideal is I have a list which the use fills in, for sack of argument Goal 1, Goal 2, etc but I have a problem. This list which the user builds I want to appear in a combobox with is quite easy using the list function and naming the range.
The problem I have is that Goal 1 or 2 can be in this list more than once, if it is at all possible I want or would like the Combobox to only show Goal 1 once and not twice or how many times it occurs. I require the Combobox just to show all Goals once no matter how many time they occur.
Am I asking the impossible if not can some one point me in the right direction?
Thanks
Naf
Re: Changing Colors On A Multipage Form
Hi,
I think your right I have looked every where for to try and do this, the only draw back is I have created the lay out and you can't change the colour of the tabs.
Thanks for the help
Naf
Afternoon All,
I have several forms each with Black Backgrounds and White text but I have now come across a problem, I have had to use a multipage on one of the forms to hold all the information.
The problem is as Default the text is black and the form is grey which doesn’t match to all the other forms, the question is can I change the text to while and the back ground to black on all the pages on the multipage form. I have been trying but I'm unable to find a way so far, I'm using Excel 2003 if that makes a diffrence
Thanks
Naf
Re: Forecolour Options Are Locked
Yep tried BackColor and it still can't change the colour, their doesn’t seem to be any options (no drop down menu) I have tried on a friends machine and I can change the colours fine?
Hello,
In the Properties for every Text box I have on my forms it's not letting me change any of the colours but I can change the fonts etc, I'm using Excel 2003, can any one help?
Thanks
Naf
Re: Activating A New Form Once A Selection Is Made From A Form
Hello,
All sorted for got to hide the original form
Thanks
Re: Activating A New Form Once A Selection Is Made From A Form
Hello,
Which ever way I try to achieve this it doesn’t seem to like the command 'show'
I have also tried
Private Sub CommandButton1_Click()
If OptionButton1 = True Then Clients1.Show
If OptionButton1 = True Then Sheets("clients 1").Visible = True
If OptionButton1 = True Then Sheets("clients 1").Select
If OptionButton1 = True Then Clients2.Show
If OptionButton2 = True Then Sheets("clients 2").Visible = True
If OptionButton2 = True Then Sheets("clients 2").Select
Unload Me
End Sub
Display More
Hello all,
I have a form with Option Buttons and once a selection has been made it opens the relevant sheet on the workbook but I can get it to open the relevant form to feed that worksheet once the selection has been made from the opening form. Is it possible to do this and if so dose anyone no the code.
Thanks
Naf
Hello,
My computer runs on Excel 2003 but my Laptop is on Excel 2000, the problem is I have the below code on a spreadsheet I wrote on my Computer which runs fine but when I open it on my Laptop it comes up with a run time error it doesn’t like the clear contents line.
If some one could explain to me why it is happening and how to get round the problem so it will work in Excel 2003 and 2000 that would be much appreciated.
Thanks
Nathan
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Sheets("data").Visible = xlVeryHidden
Sheets("Incidents").Visible = xlVeryHidden
Sheets("Front Sheet").Select
Range("A17:S17").Select
Selection.ClearContents
Open1.Show
Range("A17").Select
Application.ScreenUpdating = True
End Sub
Display More
Hi All,
Is it possible to lock a textbox on a form if the cell contains text but if it doesn’t contain any information it stays open for a user to add information to the textbox/cell and locks next time the form is view.
Thanks
Nathan
Re: Find A Value And Offsetting
I have worked out the answere please see the code below
The only problem is that I can't get it to to the same when you getting the word to serch from a text box. As soon as you enter a value it only excepts the first thing entered and then falls over
Thanks
Naf
Sub TestModule()
Columns("E:E").Select
Selection.Find(What:="Bt100", After:=ActiveCell).Offset(, -1).Value = "1"
End Sub
Re: Find A Value And Ofsetting
Quote from Reafidy
Thanks Reafidy,
I have ran the code but it doesn’t seam to work and when I run the debug it highlights “Set c” to “MatchCase” with the arrow on the last line. If you have any ideals of what is causing the problem, it would be much appreciated as I was having the same problem yesterday.
Thanks
Naf
Hello,
I'm trying to run a search and when it finds the value "Bt100" it adds a '1' into the cell on the left.
The code which I can't get to work is below
Thanks
Naf
Re: Placing A "1" To The Left Of A Urn
Quote from StephenRFor example:
CodeDisplay MoreSheets("Incidents").Select Range("C9").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],data,2,FALSE)" Sheets("Incidents").Select Range("D9").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],data,3,FALSE)" Sheets("Incidents").Select Range("E9").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],data,4,FALSE)"
could be replaced byCodeWith Sheets("Incidents") .Range("C9").FormulaR1C1 = "=VLOOKUP(RC[-1],data,2,FALSE)" .Range("D9").FormulaR1C1 = "=VLOOKUP(RC[-2],data,3,FALSE)" .Range("E9").FormulaR1C1 = "=VLOOKUP(RC[-3],data,4,FALSE)" End With
etc
Thanks for that I have cleaned the code up now it's alot easier to follow but still have teh same problem as befor I can't get the '1' to appera
Re: Placing A "1" To The Left Of A Urn
Quote from royUKYou code needs tidying up, you Select the sheet Incidents repeatedly, when three is no need to select at all, also the scrolls can be deleted.
Why are you adding formulas then pasting as values? If you are going to use VBA then use the VBA to add the value directly, I can't really say how without knowing exactly what you are doing.
I trying to pull the information from the "Data" sheet to the "Incident" sheet so it can be view and changed then if you are happy with the change you click the update button and it changes the original information on the "Data" sheet and removes it from the "Incident" sheet. Hope this makes some sense new I should have read the book from beginning to end and not missed out the middle bit lol
I will have another look over my code and clean it up but the other thing that might put another spanner in the works is that I want to hide the "Data & Incidents" sheets and I have a feeling that that is going to mess up my coding
Thanks
Naf
Hello All,
Once I have created a reference point I'm having trouble updating along that row.
This is the code I'm using I would be very grateful if some one could help me as for my first project I think I have bitten off to much but hay it stops me from getting board.
'Locating the '1' on the "Data" sheet
Sheets("data").Select
Columns("A:A").Select
Selection.Find(What:="1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
' Updating the information alonth the line that the '1' is
' This bit of code seems to updat in the same place can't get it to use the '1' as a refence point
Range("B2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],data1,2,FALSE)"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],data1,3,FALSE)"
Range("D2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],data1,4,FALSE)"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],data1,5,FALSE)"
Range("F2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],data1,6,FALSE)"
Range("G2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-6],data1,7,FALSE)"
Range("H2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7],data1,8,FALSE)"
Range("I2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-8],data1,9,FALSE)"
Range("J2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-9],data1,10,FALSE)"
Range("K2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-10],data1,11,FALSE)"
Range("L2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-11],data1,12,FALSE)"
Range("M2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-12],data1,13,FALSE)"
Range("N2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-13],data1,14,FALSE)"
Range("O2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-14],data1,15,FALSE)"
Range("P2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-15],data1,16,FALSE)"
Range("Q2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-16],data1,17,FALSE)"
Range("R2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-17],data1,18,FALSE)"
Range("S2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-18],data1,19,FALSE)"
' Removing Vlookup and leaving the corrected information
Range("B2:S2").Select
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("B2:S2").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
' Removing the '1'
Columns("A:A").Select
Selection.ClearContents
' Clearing the edited data ready for the next user
Sheets("Incidents").Select
Range("B9:T9").Select
Selection.ClearContents
Sheets("Front Sheet").Select
Sheets("Front Sheet").Select
Unload Me
End Sub
Display More
Re: Placing A "1" To The Left Of A Urn
Quote from WigiThe parentheses were at the wrong spot:
[vba]Set rng = Sheets("data").Range(Cells(1, 20), Cells(Rows.Count, 2).End(xlUp))[/vba]
The code is still falling over I have attached the complete code I have be using as it might be more help and is proberly the long way of doing things
Private Sub TextBox1_Change()
' Loading in the required URN details from the "Data" Sheet to "Incidents" so it can be change and not the original data
[incidents!B9].Value = TextBox1.Value
Sheets("Incidents").Select
Range("C9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],data,2,FALSE)"
Sheets("Incidents").Select
Range("D9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],data,3,FALSE)"
Sheets("Incidents").Select
Range("E9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],data,4,FALSE)"
Sheets("Incidents").Select
Range("F9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],data,5,FALSE)"
Sheets("Incidents").Select
Range("G9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],data,6,FALSE)"
Sheets("Incidents").Select
Range("H9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-6],data,7,FALSE)"
Sheets("Incidents").Select
Range("I9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7],data,8,FALSE)"
Sheets("Incidents").Select
Range("J9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-8],data,9,FALSE)"
Sheets("Incidents").Select
Range("K9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-9],data,10,FALSE)"
Sheets("Incidents").Select
Range("L9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-10],data,11,FALSE)"
Sheets("Incidents").Select
Range("M9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-11],data,12,FALSE)"
Sheets("Incidents").Select
Range("N9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-12],data,13,FALSE)"
Sheets("Incidents").Select
Range("O9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-13],data,14,FALSE)"
Sheets("Incidents").Select
Range("P9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-14],data,15,FALSE)"
Sheets("Incidents").Select
Range("Q9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-15],data,16,FALSE)"
Sheets("Incidents").Select
Range("R9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-16],data,17,FALSE)"
Sheets("Incidents").Select
Range("S9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-17],data,18,FALSE)"
Sheets("Incidents").Select
Range("T9").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-18],data,19,FALSE)"
' Paste specila to get rid of V-lookup
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 14
Range("B9:T9").Select
Range("T9").Activate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Range("Q10").Select
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
'Adding a '1' against the correct URN to use as a refernece for a vlookup
Sheets("data").Select
Dim rng As Range
Dim cl As Range
Set rng = Sheets("data").Range(Cells(1, 20), Cells(Rows.Count, 2).End(xlUp))
' The URN is two letters and five number and as soon as you type in the first letter of the urn the below code falls over
Set cl = rng.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
cl.Offset(0, -1) = 1
Sheets("Front Sheet").Select
End Sub
Display More
Re: Placing A "1" To The Left Of A Urn
Quote from royUKWigi is right, there is a typo.
You don't need the Selections, nor to search the whole column. No speech marks around Textbox1 either
CodeDim rng As Range Dim cl As Range Set rng = Sheets("data").Range(Cells(1, 20, Cells(Rows.Count, 2).End(xlUp))) Set cl = rng.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate cl.Offset(0, -1) = 1
Hi RoyUK,
For some reason an error is coming up it doesn’t like the word 'Cells' in the third paragraph