Sending Values Multiple Values To ONE Word File[Resolved Like A Horny Ho']
I have searched for how to do this and have the code to start up a word app: (thanks to Carl)
Option Explicit
VB Code: Private Sub Command1_Click() Dim WordApp As Word.Application Set WordApp = New Word.Application With WordApp 'create word app from default template .Documents.Add "Normal.dot" 'don't ask me to save before quiting! .DisplayAlerts = wdAlertsNone 'show the word window .Visible = True 'active the window .Activate 'send text to the window .Selection.Text = "Hello World!" 'print the page .PrintOut 'wait for document to print before quiting Do While WordApp.BackgroundPrintingStatus Loop 'quit .Quit End With Set WordApp = Nothing End Sub
But what I need to do is have users check the fields who's values they want to include in a report and have the word file as the report. Here's a GIF of what I mean:
The checkboxes indicate the values and field names to be included in the word document. Does anyone know how to do this/a tutorial for this? thank you xxxx
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sending Multiple Values Through Winsock??
Through my searching into the tutorials and programs on the internet, i noticed that all examples concerning WINSOCK (in visual basic 6) talks about sending one value from client to server.
I wonder if there is a way to send multiple values , coz i have the following task:
I have 3 text boxes in the Client program , using winsock , i want to send these 3 values to another 3 text boxes in the Server program with just one click of "Send" button.
if any body can help with the code i will be grateful
.ini File Creation/reading Values/modifying The Values
Hi i would like to store some values in a form and retrive when ever required. i would also like to modify them at runtime.
so i am thinking of using .ini file.
Help me in this regard.
Is there any other way to read/write/modify values faster?
Inputting Multiple Variable Values Inside A File [SOLVED, Thank You]
I have a variable called BlkdAddrs. I'm trying to get my program to input each value on a separate line, using the following code:
VB Code:
Open App.Path & "BlockedList.lst" For Output As #1 Print #1, BlkdAddrs & vbCrLfClose #1
However, when I look inside the file, all values are on a single line. How do I get each value on its own line?
Example: <Name@ISP.com><Name2@ISP.com> should look like this:
<Name@ISP.com>
<Name2@ISP.com>
Cannot Retrieve Values From A Multiple Line, Pipe Delimited Text File
Hi there,
I am trying to read a pipe delimited file, and then output to a blank document the 'nth' value (e.g. 1st & 4th, as I only want those values) for multiple rows in a file, namely "onlbgl1.sec", stored @ "c: emp".
The file has a header row (row #1), and then subsequent corresponding rows of data.
For each row of data I want to retrieve the 1st & 4th field/values, but I'm currently retrieving 'nothing' - see MsgBox results:
Code:
Dim npath As String
Dim inpstring As String
Dim spipe_loc As Integer
Dim epipe_loc As Integer
Dim onlbgl1(1 To 35) As String
Dim i As Integer
spipe_loc = 1
npath = "c: emp"
'get variables
Open npath & "onlbgl1.sec" For Input As #1
Line Input #1, inpstring
'need second line of data
Line Input #1, inpstring
For i = 1 To 32
If epipe_loc = 0 Then epipe_loc = Len(inpstring) + 1
If spipe_loc > epipe_loc Then spipe_loc = epipe_loc
onlbgl1(i) = Mid(inpstring, spipe_loc, epipe_loc - spipe_loc)
spipe_loc = epipe_loc + 1
'Debug.Print onlbgl1(i); i
Next i
' MsgBox (inpstring)
Close #1
MsgBox (onlbgl1(1))
MsgBox (onlbgl1(4))
Selection.TypeText onlbgl1(1)
Selection.TypeText onlbgl1(4)
Any help would be greatfully appreciated.
Thanks,
Andy
Updating Multiple Records Using Single Field Multiple Values..
dear
i have a flex in whcih i am displaying records.
lets say there are 5 records in the flex, with srno 1, 2, 3, 4, 5 and out of these 5 records i want to update 3 records srno 1, 3, 5.
srno date
1 01/12/2005
2 02/12/2005
3 10/12/2005
4 10/12/2005
5 11/12/2005
Like in delete statement we use this syntax.
delete * from tablename where fieldname in ("fieldvalue")
can we use the same concept for updating single field date in my case
can we use update like given below
update tablename set date = " & "'" & Format(Date, "dd-MM-yyyy") & "'" & " where srno in ("1,3,5")
But even after using the above syntax my data is not updated and also im not getting any error msg
hope to get helpful replies
regards
ladoo
Sending Hex Values
Hi ,
I am trying to send Hex values to the Com port
I don't know whether this is the Right way to send...
The Code is
Code:
Dim strhex
strhex = Hex(49) & "-" & Hex(33) & "-" & Hex(5)
MSComm1.Output = strhex
The string that I want to send is
1!05
since 49 is the Decimal value for 1
33 is the decimal value for !
5 is the decimal value for ENQ (according to the Ascii table given below)
The problem is i'm not receiving any acknowlegment in the com port..
please suggest !!!!
Sending Hex Values Mscomm
Before you say go and search, let me say i already have.
Situation:
My program needs to send hex values to a micro controllerthe micro controller will then carryout a fuction depending the sent sent value. I have a list of commands in Hex so i need to be able to send the data in a Hex form
(i know its gonna get converted into binary when its sent over the serial cable)
Problem:
[example i need to send value "0xF5"
how do i send the hex i realize i can send HEX vales using
MSComm1.Output = Chr$(&HF5)
But after searching i notice that it sugested to use a byte arrays. After thinking for a while i figured using a Byte Array would make more sence because there are times i need to send more than one byte of Hex values for a specific command
[example i need to send values "0xF5" 0xA1" "0xF8"]
i figured if i use a Byte array i could store all 3 values in a byte array and send that array making the code alot cleaner.(i am assuming that a byte Array holds a series of bytes)
the real problem is that am not sure how to declare a byte array, assign bytes to the array and the syntax for sending the array using mscomm.
also i would like to have a little understanding on how you let the compiler know what form the data your sending is in.
Text
Numbers
ASCII
Hex
Binary
Thanks in advance
Sending Values To Excel From VB6 (NOT VBA)
I wrote a program in VB6 and now I am trying to save those values to a sheet in an excel document that is allready created. I know how to import values into an excel sheet using VBA, but it would be more streamline if I could open the excel sheet from my VB6 program and paste the values in the correct location from there. I guess I just need a jump start, place to find information, or a simple example of this. Any help would be greatful, thanks!:
Sending HEX Values In MSComm
I am trying to interface to some external devices through my serial port. I need to send out some commands in hex, but I can't seem to do it. I also need to recieve back hex characters up to 64 bytes. I am in desperate need for help.
Also, I know that I can't open multiple ports simultaneously with the MSComm control. Has anyone ever worked with the Sax Comm control or any other? Do they work well?
Thanks
Sending Values To ActiveX EXE
I'm having trouble tracking down an answer to this.
I have 2 projects. One is an activex EXE. The other is a standard EXE. I want to run the standard EXE, and have it spawn an instance of the activeX EXE as a separate thread. I know how to add the reference to the ActiveX Exe, etc., but, when I spawn it, I want to pass it a chunk of data - actually a bunch of variables, maybe a user-defined type, which it will use as it runs in its own process.
Q. How do I do this?
I feel like I'm just missing something here. Any help is appreciated. The MS documentation doesn't seem to include this.
Thanks!
Sending Values To Outlook Express
Hi, I am trying to send out a mail with vb. I have the required To, Cc , Bcc and Attachment File Location in textboxes and want these to be transferred to a new mail message when i click a button, How do i code for this. Thanks.
Sending Values To My App From The Command Line.
I have read a few posts here about this... But.....
Basically, I have built a few apps and I keep getting questions from people such as ...does this program have command line options. I think they want to be able to pass arguments in and have my app do a "batch". Ok....the app does this....it creates and image from a label. You just type in text in a textbox and the label is created in the app. You can then save the label as a bitmap. No biggy... The problem is that some folks want to load a list of text (for example, from a text file or just multiple text) and have the program do all of them at once. I know I can do this from within the app....but what about this command line stuff. I haven't done it before.
Is there a code sample?
Thanks!
Sending Values To A Parameterized Query
Hi,
I have a data environment command object that has a parameterized query:
Select * From Transactions Where EmployeeID = ?
My form has a datagrid to be populated with the command object above. How do I send the parameter value from the form? Is it by one of the datagrid properties? Form properties? Or by code?
Thanks in advance,
Ron
How The See The Values That You Are Sending Through Serial Port Of Your PC?
Hi every body,
I am trying to write a little program what would communicate with other devices using serial port. First of all, I have to make sure that the value (1, 0) that I intend to send to com port is really the (1, 0) value. How can I test that? That is how can I see the values that I intend to send to serial port? Thanks a lot for your help.
Regards,
Sending Checkbox Values && Dates To Access DB
Hi there
At runtime the user checks either one of two checkboxes. One saying YES, implying the user had changed their brake rotors, and one saying NO, implying they did not change their rotors. They enter a few other bits of information, such as current mileage, date, etc. that the maintenance was performed. When I the user hits OK to enter the information and send it to the DB, a datatype mismatch in criteria error comes up
The Code I was trying to use for this is included below:
Code:
If chkRotorsYes = True Then Rotors = True
If chkRotorsNo = True Then Rotors = False
Can I not simply just assign those True and False values to the variable and then send it to a Yes/No field in my DB?
Another Question I have is about the date.
Code:
strCurretDate = txtCurrentDate.Text
That is all the code I am using before it is sent to my DB. Do I need to format the strCurrentDate into shorttime to match the ShortTime field in my DB in order for this to work?
Multiple Values
Inserting multiple values... what would be the best way to do this?
MyConn.Execute ("INSERT INTO Student(Firstname, Lastname) VALUES ('" & strfirstname & strlastname & "')")
getting "Number of query values and destinations not the same" error.
thanks in advanced.
Multiple Values
Does anyone have any insight on getting Crystal Reports to allow for multiple values when used in conjunction with a stored procedure? I am preparing a report that is focused on vendor numbers. The user wishes to be able to search by either one vendor, multiple vendors, or all vendors. The way I prepared my stored procedure allows for all vendors or for a single vendor, but I can't seem to get Crystal to allow for multiple vendors. Does my question make sense, and is there a work around for this problem?
How To Make A Form Default All Field Values To The Previous Records Values ?
Using Access2000 on 2k.
Have a database form in single form view (has a sub form in it).
Got a request to put in a button that will do the same as new record but default the new record to all the same values as the current forms record shows. I think there are several ways to do this, I'm afraid I'll pick the most difficult one if left to my own devices. (i.e. DAO recordset looping etc.)
The first thing I tried was using a wizard to add a button and chose the duplicate record offer from the wizard. It almost works but it presents a record without the arrow or the pencil in it, gives it a record number that makes me think it has appended it. but when I move away from the record and back to it again, it's empty.
If I right click and copy and then paste it does what I expect it to. That is put the copied information in the end record.
But the user doesn't want to copy and paste, they just want to push the button and then modify the needed fields.
I wizard gave me code that looks like this:
Private Sub cmdDupRec_Click()
On Error GoTo Err_cmdDuplicate_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_cmdDuplicate_Click:
Exit Sub
Err_cmdDuplicate_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicate_Click
End Sub
Possible?? - 2 Projects Sending Values To Same Textfile Or Excel Sheet
Hi,
I have 2 projects one with vb and the other a Word Document that are connected to each other. I have read about Group Projects. Would that be necessary in my case. If its complicated I'd rather not, but if its absolutely necessary for data transfer, I need help.
Well each student is to send values to one common textfile. At the moment I am only sending from vb. Is there a way to collect values from vb and Word. The program will run in the school server not on a stand alone PC??
Later I need to transfer the textfile to an Excel sheet. Maybe I thought there is a way to send data to an Excel sheet straight away?? I'm Not very experienced in vb I'm afraid. pls help me to go about it!! Thanks
Sending Function Values From Client To Server- Pls Guide
Hello Everybody:
I have created two Functions whose value I want to send from the client to the server. The Functions are defined as
follows:
Client Code
Function Parameter(ByVal name As String, ByVal value As String, ByVal remote As String) As String
Dim param As String
txtusername = name
txtValue = value
txtRemote = remote
param = name + " " + value + " " + remote
End Function
Function Variable(ByVal URL As String, ByVal TarFrame As String, ByVal ContactURL As String, ByVal ContactTarFrame As String) As String
Dim var As String
txtURL = URL
txtFrame = TarFrame
txtContactURL = ContactURL
txtContactTarFrame = ContactTarFrame
var = URL + " " + TarFrame + " " + ContactURL + " " + ContactTarFrame
End Function
Private Sub cmdSend_Click()
tcpClient.SendData Parameter(name, value, remote)
tcpClient.SendData Variable(URL, TarFrame, ContactURL, ContactTarFrame)
End Sub
Server Code :
Private Sub tcpServer_DataArrival(ByVal bytesTotal As Long)
Dim strData, strData1 As String
Parameter = strData
tcpServer.GetData strData
txtOutput.Text = strData
Variable = strData1
tcpServer.GetData strData1
txtOutput.Text = strData1
End Sub
When I run the code. I am not receiving parameter and Variable function values in txtOutput.Text..
Pls guide…
Rahil
Sending Keystrokes And String Values From A VB Program To A DOS P Rogram
I wish to send a value (string) from an Excel spreadsheet cell to a DOS
program.
Any idea how I might accomplish this?
Also, I find that the SendKeys command dosen't work in a DOS window, so I
need to come up with a way to send keystrokes programatically to the DOS
program. Any help?
I'm using VB 6.0.
Wayneth
How Can I Compare Multiple Values At Once?
Is there a comparison operator or keyword that can compare multiple cells/values at once? What I mean is, I have to execute code IF ALL instances of a cell value are equal.
Actually it's IF value x repeats Then FOR EACH INSTANCE of value x(could be 2, could be 5 or more...) - IF Value y(13 cells over) is equal(in each record/instance of value x), THEN Do something...
I am new and cannot seem to do it with just If-Then statements....
Thanks for any help!:wall:
Sum Multiple TextBox Values
Hi,
Any help would be appreciated. I've created a form to be used in conjunction with a worksheet. The worksheet has a sum function for the range total, but I'd like to sum the textbox values on the form in order to validate the range total. I've looked around on the site and found mulitple threads on the subject, but I can't seem to get any to work. The form has about 40 textboxes, with most formatted as currency. I'm a newbie so the more detail the better. Thanks in advance.
Multiple Values From A Function
Hi everyone.
In my app I have numerous places where the code draws a line on a background picture box, using some (not really complex, but tedious) trigonometry to calculate where to put it. The calculations take three inputs - an angle and two offsets - and calculate the four values X1,Y1,X2,Y2 that represent the co-ordinates of the two ends of the line.
At the moment, the calculations are actually typed out in the procedure for every instance of drawing the line. I wanted to change it to put the calculations in a function that would return the four variables, but it seems from my reading that a function can return only a single value, named with the name of the functon.
Is there a way to get four values back from a single function call, or is there a different way to approach encapsulating this trig?
Richard
Multiple Values For A Variable
Hello World!
I am looking for a way to make a variable have multiple values, but not really like an array...for example:
Blah = 25,200,0,1,rgb(0,0,255),0,0,0)
right now the way I have stuff done is really bulky, but if I could do that, I could reduce my stuff to a few lines of code...any suggestions??
Assign Multiple Values
assign multiple values to a lable (or button)
Hi, I have a question. I'm new to visual basic programming and I'm stuck at something. How can I assign multiple values to a single lable. forexample, a lable has 3 values stored and when i click once i get A and if i click twice i get B three time C.. etc sorta like a mobile phone button function. How can I do it?? what functions do i need to learn to be able to do it.. thank you so much for the help. much appreciated
Passing Multiple Values Into A Sub
I can't figure this one out.
VB Code:
Private Sub potFlop(ByVal call as Integer, pot as Integer, river as integer)
It asks for an identifier..?
Saving Multiple Values
Hey guys, I was wondering if anyone can suggest the best way to save a large number of variables and call them back again. (And by suggest I mean a tutorial or link to a tutorial as well :P)
Thanks in advance.
How Do I Return Multiple Values?
I tried making a function that took 4 varibles ByRef in hopes that function could change them and when the function ended the new values would be back in the caller function. Like a reference should, right?
Is there anyway to get this done?
Thanks,
NOMAD
Multiple Combos In IE With Same Values
I posted this in the ASP forum.. but no one browses it
sorry for posting it here.. but my boss wants this done ASAP
I have an ASP page that I need to load 14 combo boxes with the same table from a database... I don't want to have to open the recordset 14 times... so if I load the first combo.. how can I copy all the elements of the drop down to the other combos.. this is only from IE 5.5+ so I can use client side VBScript....
Multiple Values In A Field
Hi,
I have a database that needs to store (and search by) invoice numbers. I was just going to use a field called 'Invoice_Numbers' however I've found out that there may be multiple invoice numbers accosiated with each record.
How do i store multiple values in a field and be able to search the database for them?
I can just have multiple fields like 'Invoice_Number_1' , 'Invoice_Number_2' etc as I don't know how many invoice numbers there may be!!
If you can help I would be very greatfull!
How To Add Multiple Values In One Field
my program is goingto be used to monitor the sales and inventory of a certain company. in entering the purchase of a customer, i first add all items to be purchased on a listview. then i would like to add to the database the items purchased. my problem arises when the customer purchases several items. how would i enter the products purchased into the database if there are more than 1 item purchased? I need a way to add the products purchased under one transaction.
my database contains the following fields:
transaction_id - primary key
customer_id
purchase_date
product_id
quantity_purchased
mode_of_payment
i have included a screenshot if it helps. any help would be greatly appreciated.
Edited by - LiquidAngel on 8/25/2003 11:57:42 AM
Multiple Values For One Field In SQL
I am kind-of-new to SQL and how they work.
I have two tables in an Access database, I want to do a sql search in table1 to get a list of values to look up in table2.
Table1 has Fields (CustomerName)(Route)(FuelSurCharge)
Table2 has Fields (Route)(RunValue)(DateValue)
Table1 allows the user to assign a CustomerName to a Given Route, that customer name can be assigned to many different Route's.
Table2 is the main Database which keeps the Route and RunValue.
My SQL needs to be able First look up from Table1 all Routes that are assigned to a CustomerName then from table 2 look up all the Route values with that Route name.
I tried to create part of the Sql statement and appending to the final sSQL statement like so...
SQL = "Select * From Table1 Where CustomerTable.Customer Like '" & CustomerNameStr & "';"
cnt = 0
If Len(CustomerNameStr) > 0 Then
Set rsAccess2 = New ADODB.Recordset
rsAccess2.Open SQL, objAccessConnection, adOpenKeyset, adLockOptimistic
While Not rsAccess2.EOF
cnt = cnt + 1
If cnt > 1 Then
Croute = Croute & " And Like " & rsAccess2!Route
End If
If cnt = 1 Then
Croute = rsAccess2!Route
End If
rsAccess2.MoveNext
Wend
rsAccess2.Close
End If
sSQL = "Select * Table2 Where Table2.DateValue >=#" & stStartDate & "# and Table2.DateValue <=#" & stEndDate & "#"
sSQL = sSQL & " AND Table2.Route Like '" & Croute & "'"
sSQL = sSQL & ";"
I have much more information in the Tables then what I have shown but this give the general ideal.
I'm not sure if I am using the AND correctly or if there is better way to do this.
Thanks!
Values {read Values From Excel Sheet Using VBScript}
Hi to all,
i'm trying to do an vbscript file that reads an excel column
(as long as it has a value) and then sum the all cells' values.
If I have
3
1
5
4
it should give:
there are 4 rows
the sum is 13
this is what I have done till now but i don't know how to go on.
Can anybody please help me?
thank you
Code:
Set ob= CreateObject("Excel.Application")
file = "c:file.xls"
ob.WorkBooks.Open file
Set sheet= ob.ActiveWorkbook.Worksheets(1)
ReDim cell(200)
indicator= 1
Do While sheet.Cells(indicator, 1).Value <> ""
cell(indicator) = sheet.Cells(indicator, 1).Value
pappa = cell(indicator)
msgbox pappa
indicator= indicator+ 1
loop
rows= ?
total= ?
ob.ActiveWorkbook.Close
ob.Application.Quit
Looking Up And Comparing Multiple Values/conditions
I have a project I am working on that involves, mailing letters based on what health plan the consumer is on (I work for an HMO). But it doesn't end there. There are 3 different "plan" letter versions, but also 3 versions of each (one for adult individual, one for child, and one for entire family).
I get the data from a sql query I run which tells me the plan, age, etc...
I am at a loss, however, on how to state: "If the subscriber # shows up more than once, AND all instances of it show the same Dr. #, then send family letter. (We have codes to refer to each letter version). Otherwise it is just and individual letter OR a child letter based on the age of consumer and based on the plan name....
I assume it will be some kind of array?
Does this make sense? Can anyone help? Thanks.
Problem With .Find Multiple Values
Hi everyone,
at the moment, I'm using the Find method to find a specific value (1) in a column, then copy the entire row and paste it to another sheet, using:
With Worksheets("Sheet1").Range("G2:G1000") 'UsedRange
Set c = .Find(1, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.EntireRow.Copy
Worksheets("Sheet2").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
My problem is that I now want to find multiple values. That is, anything greater than zero. Is there a way that I can replace the "1" in my find method to do this?
Sharing Values In Multiple Forms
In my application, a second form opens up and asks the user for some information (3 integers) which is input into 3 seperate textboxes. I need to use these values in the original form but for some reason when focus goes back I keep getting a all values of zero. How do you pass values from form to form?
How Do I Accomplish The Corresponding To Multiple Values In Listbox?
Hey!
As a total newbie I'm trying to develop a program to sort different kinds of data in Access DB.
My first form is supposed to administrate the different categories that the data is sorted under. Now I want dynamic subcategories, meaning any category can be set as a subcategory to another (tho only to one). This rendering the possibility of a infinite number of levels.
Coming from PHP my solution to this was to simply have a table with CatID, CatName and CatParent. A subcategory would then simply have it's parent's ID set in the CatParent column.
I've added some categories from Access in order to start making the inteface used to update categories and I've created a listbox that is populated by this code:
General declarations:
Code:
Dim MyConn As ADODB.Connection
Dim rsCategories As ADODB.Recordset
Dim strLevelDots As String
Private Sub Form_Load()
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "Notes2.mdb;"
MyConn.Open
Set rsCategories = MyConn.Execute("SELECT CatID, CatName FROM Categories WHERE CatParent = 0")
Do While Not rsCategories.EOF
lstCategories.AddItem (rsCategories("CatName"))
strLevelDots = ""
FindChildren (rsCategories("CatID"))
rsCategories.MoveNext
Loop
End Sub
Sub FindChildren(intParentID As Integer)
Dim rsChildren As ADODB.Recordset
Set rsChildren = MyConn.Execute("SELECT CatID, CatName FROM Categories WHERE CatParent = " & intParentID)
strLevelDots = strLevelDots + "..."
Do While Not rsChildren.EOF
lstCategories.AddItem (strLevelDots & rsChildren("CatName"))
FindChildren (rsChildren("CatID"))
rsChildren.MoveNext
Loop
End Sub
What this code does is to first find all categories that don't have a parent. For each of those the FindChildren()-function is called. The function then finds all children to the category, add's them to the listbox with three dots in front of them and then calls itself again, finding the childrens of that specific children/parent.
So far so good. I dunno if the code is good but atleast it does what I want.
Now my problem is this: When the user selects a category from the listbox I want other fields populated by that categorys data from the DB. I could just use the Replace function and parse away the dots and select the categorys data with the cat's name. However, I want it to be possible to have several categories with the same name, so in some way I need to be able to pass the categorys ID instead of the name from the listbox. How would I go about to do this? Coming from webdevelopment I would simply just assign the ID to the dropdowns value, but as I understand it the value and what's displayed in the listbox is the same?
Thanks in advance for any help,
Values In Multiple Areas Problem
I’ve a range consist of multiple areas. “D$58:$H$58,D$60:$H$61”
When I count the number of cells it gives the number of cells in the areas (15).
But when loop through the cells(i, j); it is indexing them as one continuous range like “D$58:$H$61”
Is there a way to get only the values of the chosen cells?
thanks in advance
Paste Values For Multiple Sheets
I am trying to write a command that will unprotect all worksheets, copy all cells on each worksheet, paste the values on the same sheet (replace any formulas with their values), re-protect all worksheets and then save the file. The code I am using is below. The protect, unprotect, and save all work fine. What I can't get to work is the copy and paste. It will only copy and paste the active sheet and will not switch to the next sheet. I am not an expert in VBA by any means, so this may be an easy fix.
Help!
Sub CommandButton1_Click()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="password"
Next ws
Application.ScreenUpdating = True
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Activate
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Next ws
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="password"
Next ws
ActiveWorkbook.Save
End Sub
Assign Multiple Values To An Array
I'm wondering how you assign multiple values to an array at one, i think in c++ and java it's along these lines for example:
myArray() = {1,2,,3,5,2,4,7,,8}
can you do similar to this in vb on 1 line?
Listview With Multiple Field Values
I have a listview that is populated from a certain table. I only want to display items within the listview that appear more than once. Here's the code for populating the listview with all the field values, but as I said I just want the ones where the id appears more than once. Can someone help?
Code:
Set rsAreas = New ADODB.Recordset
Set rsAreas = xData.AllTableRecords(GetDL(), GetIC(), "areas", "id,descript", False, True, "id")
Dim itmX As ListItem
While Not rsareas.EOF
If Trim(oAll.ReturnFieldValue(rsAreas!id)) <> "" Then
Set itmX = oMyForm.lvwLetters.ListItems.Add(, , Trim(rsAreas!id))
If Trim(oAll.ReturnFieldValue(rsAreas!descript)) <> "" Then
itmX.SubItems(1) = Trim(rsAreas!descript)
End If
End If
rsAreas.MoveNext
Wend
rsAreas.Close
Set rsAreas = Nothing
Exit Sub
Multiple Values For Crystal Rpt Paramaters?
Hey all.. i'm writing a visual basic program that incorporates crystal reports. I've added a paramter to the report and i wrote some code so the user isn't prompted for the value of the paramter. the code is as follows
Set crpParamDefs = m_crReport.ParameterFields
For Each crpParamDef In crpParamDefs
Select Case crpParamDef.ParameterFieldName
Case "[THE_NAME_OF_YOUR_PARAMETER]"
Call crpParamDef.SetCurrentValue([THE_VALUE_TO_SET_IT_TO)
End Select
Next crpParamDef
Here is the problem.. when i setup the paramater i set it up to allow for multiple values... but it appears SetCurrentValue only allows 1 value.. how can i pass the paramater more than one value in VB? Thanks a lot to all replies
Average Of Multiple Values On Form
in access:
have a form which displays 10 values, linked to 10 different fields in table. Sometimes numbers are entered into all 10 fields, other times only some of the fields will have numbers entered.
I want to be able to display the average of the values entered into the 10 fields, remembering that some of the fields may be blank, so a simple (field1 + field2 + ... + field10) / 10 will NOT give the correct result.
As I understand, the avg function can only work on single fields in this situation. Is this correct?
Please help!
Multiple Values For An Item In A Combo Box
Hey Guys,
Is there any way to have a multiple value for an item in a combo box, i.e: like in HTML when you have a form item
<select name="combo">
<option name="item1" value="1">Item1</option>
</select>
The display name is Item1 but the value of this item is actually 1, can this be done in vb?
I'm populating a combo box from a database and I want the string to appear for the item in the list but I want it's id to actually be the value.
sorry for the HTML code, but it's an easy way to explain the problem.
thanks!
Crystal Reports 7; SP's And Multiple Values
I have noticed in Crystal Reports 7 that when I use a stored procedure that I am not allowed to select multiple values in my parameter fields. Does anyone know a work around to this problem???
|