Display Number Of Lines Which Depends On Value Pass By User
Jul 17, 2013
I am trying to display number of lines which depends on value pass by user. Actually user is passing some value. On which some group of lines has to be display.
E.g.
for 1 value 9 lines
for 2 value first 9 lines + another 9 lines
for 3 value first 18lines = 9 lines
and so on till 52.
View 2 Replies
ADVERTISEMENT
Jul 17, 2013
I am trying to display number of lines which depends on value pass by user. Actually user is passing some value. on which some group of lines has to be display.
eg
for 1 value 9 lines
for 2 value first 9 lines + another 9 lines
for 3 value first 18lines + 9 lines
and so on till 52.(this 9 lines are set of some column and rows)
thus cant use macros..
View 1 Replies
View Related
Apr 2, 2009
I have a workbook that is used to track overtime hours worked through the year. I've received some help from users on this forum, and others, to create the necessary macros and formulas to allow a supervisor to make use of the form; however, the workbook is also used to track those that wish to volunteer to work overtime each weekend. The sheet has a list of names for the employees on each shift, then a column to allow a "Y" to be placed under the date - designating them as a volunteer for any overtime available. I've found this spreadsheet (attached - from this site) that will allow individual users to access the workbook and have unique passwords for each. I don't completely understand how it works, but I feel it may be a start to getting what I want.
Essentially, once the user selects their name and inputs their password, I'd like the workbook to be opened and then allow them to only manipulate the row associated with their name. That row will change from week to week, so specific numbers will not be able to be used, but their name will be the same as the name used in the logon.
I feel like I'm asking for a lot here, so just some initial guidance on whether this type of thing is possible would be an acceptable answer.
View 9 Replies
View Related
Apr 8, 2014
I want excel formula to calculate the sum the value of partused depends upon serialno repeats where repeats of end of serial no i want result at end of every multiple serial no end cell.
View 2 Replies
View Related
Jun 24, 2006
I have created a custome User Form with three option buttons inside a frame. How do I set the value for each button and then how do I pass that value back to the code that opened the form (after closing the form upon a selection?
Sub Test2()
UserForm1.Show
Select Case List
Case 1
Range("b1").Value = "List 1"
Case 2
Range("B1").Value = "List 2"
Case 3
Range("B1").Value = "List 3"
End Select
End Sub
in the form I have the following code associated with each of the butons (but I do not think I have it right). Isn't there a way (becasue I have them in a frame) to shorten the code?.................
View 8 Replies
View Related
Sep 9, 2006
I have an existing macro which I am enhancing and I would like to have the user provide a date, either with a popup text box in a userform and then use a command button to hit OK and have the box dissapear, or in a calender which the date is selectable, and the date supplied go into a variable.
View 2 Replies
View Related
Dec 28, 2006
I am trying to write a User Defined Function in VBA to perform a simple two-dimensional table lookup. I have the temperature distribution in a solid given in a table in Sheet2. The first column of the table contains the time values, the first row contains the spacial values (radii), and the intersections contain temperature values. These ranges are named times, radii, and temperatures. In Excel, I can perform the lookup using: =index(temperatures, match(time, times, 1), match(radius, radii, 1))
But how do you do this in VBA? More specifically, how do you deal with passing ranges to the WorksheetFunctions?
Function temperature_ref(time_range As Range, radii_range As Range, temperatures_range As Range, time As Double, raduis As Double)
r = WorksheetFunction.Match(time, time_range, 1)
c = WorksheetFunction.Match(radius, radii_range, 1)
temperature = WorksheetFunction.Index(temperatures_range, r, c)
End Function
This function would be called (from any worksheet) as..................
View 4 Replies
View Related
Oct 17, 2007
I have an array with structure, i.e. User Defined Type. Assume the user defined type has two elements: Element1 and Element2 and array name is Array.
So the definition is:
Dim Array(1 To 10) As UserType
and access to elements is
Array(5).Element1
The problem is that I need to pass the whole set of Element1 or Element2 to a function. Should it have been two separate arrays, it would not be a problem. But because of the user defined structure I have no idea how to pass a single element.
I hope there is another solution rather than to use loops. I have many arrays like this with complex structures. I simply can not replicate all of them.
View 9 Replies
View Related
Sep 23, 2008
I would like to know if will be possible to display a comment when I pass the mouse over a vba button?
View 11 Replies
View Related
Dec 23, 2009
I am trying to call a function that calculates forecast error (wMAPE). This function needs to be able to handle passing in non-contiguous ranges. I can't seem to figure out how to do that.
Function wMAPE(Forecasts As Range, Actuals As Range, Weights As Range) As Variant
Dim Denominator As Double
Dim Numerator As Double
Dim i As Long
Dim Fcst As Variant
Dim Act As Variant
Dim Wt As Variant
If Forecasts.Cells.Count Actuals.Cells.Count Then MsgBox ("Error: Arrays not same size")
If Forecasts.Cells.Count Weights.Cells.Count Then MsgBox ("Error: Arrays not same size")
Denominator = 0............
View 9 Replies
View Related
Jan 10, 2007
I have a cell containing a address. I have used alt-enter to separate lines of the address. I have a userform that contains a textbox which which loads the cell containing the address. The problem is once the useform is loaded the address in the textbox is all on the same line and contains a funny looking back the front P character where I have used alt-enter in the cell to make a new line. This ones got me knackered.
View 2 Replies
View Related
Aug 11, 2009
Is it possible to show a table in a user form? For example I have a table that is 4 columns wide and 5 rows deep with lines seperating both. I have tried using a text box and list box to achieve the results I am looking for but can't figure out how to add lines to seperate data between rows and columns.
View 5 Replies
View Related
Apr 28, 2014
How to set up a Inputbox to make the user pick the start line and end line for a loop
the sheet will have items on it numbered 1,2,3,etc I want a process done to the lines the user selects by item number not cell range.
line 4 to line 20 for example.
View 4 Replies
View Related
Jun 24, 2014
right I have 5 columns
A
employee id
B
Date exposure
C
Total Exposure
D
First Name
E
Last Name
I want to be able to filter by employee id I'm using this formula below
=SUMPRODUCT(('Excel Exposure Grapth'!B$2:B$4000<>"")*(MONTH('Excel Exposure Grapth'!B$2:B$4000)=1)*('Excel Exposure Grapth'!C$2:C$4000))
but problem I'm getting it count all dates even after the data is filtered
For Example
if I had 2 employee's
EmployeeID 1 had 6 dates in January
EmployeeID 2 had 10 dates in January
if I was to filter to only show EmployeeId 1 it will only show 6 dates but the formula above counts everything even if filter applied
View 2 Replies
View Related
Sep 12, 2007
How can I break this onto 3 lines in Visual Basic Editior to make it more readable:
MsgBox "Only enter data in white cells." & vbNewLine & "Yellow cells contain formulas or dates entered automatically", &
vbNewLine & "Do not insert blank rows. Copy row(s) and Insert/Paste" , vbInformation, "Spreadsheet by GJF"
View 4 Replies
View Related
May 12, 2014
I'm trying to create a completion statement on where I will add up the money my client has sent to me and also add up the money I need to pay out in order for them to complete their transaction. The end result I want is I would like to display whether my client has given me to much money and I need to repay them. Or if they haven't given me enough then I need to invoice them. I need excel to display for me after all the figures have been added and subtracted if the end figure is negative then display in D19 (balanced owed to you). If the end figure is positive (Balance required from you) display in D20.
View 12 Replies
View Related
Aug 15, 2008
Following statement works for me:
bdcTerm1 = ThisWorkbook. Sheets("ws2"). Range("A1").Value
But instead I want to parse through 50 rows and dynamically get the value instead of using a static Range("A1"). So I am trying to do the following:
For Row = 1 To bdc_rows
bdcTerm1 = ThisWorkbook.Sheets("ws2").Cell(Row, 1).Value
bdcTerm2 = ThisWorkbook.Sheets("ws2").Cell(Row, 2).Value
Next Row
But I get errror.
View 5 Replies
View Related
Aug 12, 2007
This line in my code is causing an invalid qualifer error message:
lngNew = wsNew. Range("B65536").End(xlUp).Row.Offset(1, 0)
Option Explicit
Sub Disney_DumpData()
Dim wbBook As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim wsNew As Worksheet
Dim rng As Range
Dim rngNew As Range
Dim rngUnit As Range
Dim rngUnitPaste As Range
Dim lngNew As Long
Dim Cnt As Integer
Application. ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
Set wbBook = ThisWorkbook
Cnt = 0
'Dump To New File
'/Define new workbook
Set wbNew = Application.Workbooks.Add.....................
View 7 Replies
View Related
Jun 13, 2009
I have a VBA program in Excel that creates an Access Database. There are 4 tables and below are the SQL statements that create the Database. There are more fields associated with each table. When I go to Access the tables look great and I do not get any error messages.
[code] ...
When I send, “write” records from Excel to the tables the record's data is written correctly, the AcountInformation [RecId] updates with an auto number correctly the Primary Key auto number of each of the subsequent tables updates correctly.
The Foreign keys do not contain the record number from the, “refers back to AcountInformation [RecId] Primary Number”. Every thing works except the updating of the Foreign Key
I have tried everything even going into access and manually deleting a record from AcountInformation table to see if it deletes the appropriate records in the other tables and updating a record. It does not update and or delete the records from the other Tables.
The bottom line, Access does not pass a Primary key number to the Foreign Key.
View 9 Replies
View Related
Aug 4, 2007
I am trying to create a macro (please look the attached excel what I have done), I have already crwated a macro that after 5 seconds is gonna change the background color of the of the cell en function of another cell.
That means if F3:F4 change the background color F8:is going to change the backgorung color also, every 5 seconds. The macro I wrote is also include in the excel attached file.
Now this is my problem... I have a variable cell that is give for D6 which could be A,B,C,D,E,F (Range F2:K2).
If the variable cell D6 is A the background color of F8:F9 should be the background color F3:F4 .
If the variable cell D6 is B the background color of F8:F9 should be the background color G3:G4 .
If the variable cell D6 is C the background color of F8:F9 should be the background color H3:H4 ......and etcetera.
View 5 Replies
View Related
Aug 28, 2007
what i need to do is store the number of rows visible on the data sheet (after a data filter is applied) into a variable so i can do a calculation with said data. Is there such a command?
for example....
data:
row header a | row header b
line 1
line 2
line 3
after auto filter:
row header a | row header b
line 2
code stores number of rows visible into a variable....
vVariable = rows visible... in this case 2 (NOT 4... which is the total rows including hidden)
View 5 Replies
View Related
Aug 18, 2007
I am setting a variable to the value of an absolute cell reference. I want to set the value of another variable to just the row value of that absolute cell reference.
View 4 Replies
View Related
Aug 24, 2007
I have uploaded a copy of the spreadsheet I am working on and have completed the user forms and coding for march the 1st only, so if you test, please use the options march and then the 1st!
The problems i have is, when I enter a number into a text box and press next page, the numbers fill where i want them to but the cells do not recognise them as numbers, therefore conditional formatting doesnt work! Even if I change the cell properties to numbers, this does not remove the error!
Second problem!! If a user forgetts to enter a value in a box, or they wish to edit just one value, and go back into the user form to change a figure, when they press next page, all the values in the column seem to disappear!
View 6 Replies
View Related
Oct 5, 2007
I use the code below to enter a value from a list box in a cell on a workssheet. Is it possible to code VBA to enter a number for the position of the selection in the listbox to a cell in a worksheet rather that the actual value from the list box. For example if my list is:
Option1
Option2
Option3
And I click on Option2 in the list, I can sennd the value 2 to a cell on the worksheet rather that the value "Option2' from the list.
Private Sub ListBox1_Click()
Sheets("SA").Range("SA_Poistion_To_Archive_A_New").Value = ListBox1
End Sub
View 2 Replies
View Related
Apr 7, 2006
I want to display a control to the user so they can select a folder. I'm assuming that the proper control would be the FileSystemObject.
If that assumption is correct, I would think the first part of the code would be something like:
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
View 9 Replies
View Related
Feb 12, 2014
I am trying to search through column "I" for numbers that are decimals, when the first decimal is found, use the row number that the first decimal appears in the string that populates the bookmarks stored in a word template I have created. The code I have so far checks for the decimal and then populates the bookmarks, however it requires me to input the ranges manually, meaning I can set them as the first row in my tabel. But if the decimal appears in the second row and not the first I'm bookmarking the wrong data. Here is the code I have so far;
[Code] ........
View 3 Replies
View Related
Jul 14, 2009
I am writing a macro in which the user selects several ranges (entire columns) for the macro to manipulate. I display a userform to the user that contains 16 refedit objects (1 for each range that they picked). Unfortunately, the value that appears in the refedit boxes is not very user-readable. It looks like this:
'[WorkBookName.XLS]Sheet1'!$B$5
I can assume that all of the ranges will reside in the same workbook, so I have been cutting the workbook name portion off as a string and displaying it in 1 place only. I can leave the value of the refedit as: Sheet1'!$B:$B, but even that is not very friendly. Of course if I do change the value of the refedit controls then I will need to "fix" them before attempting to access the range.
Does anyone have a suggestion as to how to display the sheet and column of the range to the user?
View 6 Replies
View Related
Jul 21, 2007
I am building a Workbook which takes data from SheetA and inserts it into SheetB.
Part of the data is only entered when a positive value exists.
I then do an export from SheetB.
The problem is that I need to get the column number and pass it to the cell reference based on the field name in row 1.
Dim sFindstring As String
Dim rFindcell As range
Dim iR As Integer
Dim iC As Integer
sFindString = " Find this string in the cell"
'Using cells find the findstring
Set rFindCell = Cells.Find(What:=sFindString, After:=[A1], LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
'OK so look here
iR = 3
'I am trying to pick up the column number
iC = rFindCell.Column
rFindCell throws an object or with block variable not set error. Is there some property that I need to set.
View 3 Replies
View Related
May 24, 2009
I have code (below) that works if the range "ImportFile2" contains a valid value but I want users to be able to select any .csv file preferably from a directory which should be held in a cell.
I added ...
View 9 Replies
View Related
Jul 7, 2006
I have a Excel database and a userform to look-up reocrds. I want to be able to connect a Data Sheet which is a PDF file to every product in the daatbase.
I have created an additional column and created hypelinks in front of each product. these hyperlinks are connected to the datasheet of that product which is saved on the drive.
I have created a field on the userform to display the respective hyperlink when a record is searched by user.
My problem is that the user form displays the hyperlink name, but its dead.
I want users to be able to click on the hyperlink to view the attached Datasheet. I have tried using Textbox and labels to display this hyperlink,
View 6 Replies
View Related