Answer Questions
tommazzo Delete Unwanted rows based on value in cell
Hi all, I have to loop through a range of rows with an excel sheet and delete unwanted data. To identify the rows to be deleted I have to do the following: Firstly I must start at A1 and check if it contains the value "Product", if not i go to the next row but if it does i must then delete this row and go to the next. I must then check that the next cell contains the value "Total", if not i go to the next row but if it does i must then delete this row and go to the next. I then need to delete each of the next rows until i find the next cell that contains the value "Product", delete this cell and then go through each of the next rows until i find the next cell that contains the value "Total&quo ...Show All
Ntc Projects, objects & modules
I started learning VBA in MS Word yesterday. I have some programming experience in C++ and Java. I am trying to understand how the environment is structured and what Projects, Objects and Modules represent. For example I recorded a few macros using the macro recorder and then opened the VB Editor to see what was created. I notice that under "Project" are 3 folders. One is named "Microsoft Word Objects". Within this folder is what looks like a file named "This Document". What does "Project" represent What does "This Document" represent What is the difference between "This Document" and the "Project&q ...Show All
SoulSolutions Install BSM Server error!
Hi all, I had to install BSM Server on myserver. I found the error as below. Error -2147217900: failed to execute SQL string, error detail: The role 'BPMDeveloper' does not exist in the current database., SQL key: SQLWeb3 SQL string: USE ScorecardServer DECLARE @dbowner sysname SELECT @dbowner = SUSER_SNAME(sid) FROM master.dbo.sysdatabases WHERE name = 'ScorecardServer' IF NOT(@dbowner = 'NT AUTHORITY\NETWORK SERVICE') EXEC sp_addrolemember 'BPMDeveloper', 'NT AUTHORITY\NETWORK SERVICE' Who're know how to fix this error Rgds., Cherming ...Show All
learningdba How to use ADO retrieve MSAccess attribute ?
i want to know the table is hidden. Hi, There is no direct method of ADO to list table property. If you want to stick with ADO, then you have to include the ADOX library (ADO extension), from there you can have access to the database schema. Alternatively, you can use DAO to list the object in the database, in DAO there is a property named TableProperties. Hope this can help. ...Show All
Jim Perry Select query returns non-existing data
Hello everybody, I'm trying to match entries in a table up against each other based on a number of criteria (Quantity, Date). Three types of entries exist: Those from source 1, 2, and 3. I'm trying to match data from source 1 with data from source 2 and 3. Some is identical, some is not. In a VBA Script I first select every entry from source 1 (indicated by the field "Datasource"). I then run a While loop. For each entry I run a second select query on the fields I want to match (Quantity, Date). It works OK, ie. as expected, in some cases. In other cases, the quantity is completely off - it's as if Access just invents some random quantity instead of using the one from select query one (the one with source 1 data). What on Earth is w ...Show All
Vivienne.Zhou Running a macro if new mail if from a specific address
Hello, I'm currently trying to write a macro that is run when new mail is received in Outlook 2002 (possibly XP not sure though) I would like the macro to check if the new email is from a specific address (in this case sales@falcontrunking.co.uk ), delete the email, and display a message saying "There is a new message in the Sales Inbox". I know how to run a macro when a new message is received and I know how to show a message box saying "There is a new message in the Sales Inbox" but I don't know how to check if the new message has been received from a specific address. Can anyone help me Create a MailItem object from the new message, and compare the MailItem.SenderEmailA ...Show All
&#169&#59; Ţĩмό Şąļσмāĸ How to populate a list box using adodb recordset
The error occurs when I assign the rs to the list box. Thanks, Steve C. Private Sub sortData() On Error GoTo Err_catch dim dbConn as New ADODB.Connection dim rs as New ADODB.Recordset dim strSQL as String Set dbConn = New ADODB.Connection Set rs = New ADODB.Recordset 'Create database connection dbConn.Open "Provider=Microsoft.jet.oledb.4.0;" & _ "Data Source=" & CurrentProject.Path & "\data\NED_DATA.mdb;" strSQL = "SELECT [ID],[GLOBAL STATUS], [AFFILIATION],[REGION]," & _ " [COUNTY], [RN], [A DATE]," & _ " [A STATUS], [GLOBAL], [ENTITY NAME]," & _ " [TYPE], [LASTNAME], [ ...Show All
Andrew Lynes ms access
folks..any ideas on how to enable an Ms Access database to send an e-mail when it is updated is it easier to do from within access or via a .NET app ( doing a simple check on the db tables to look for changes) any ideas thanks Hi, 1. When data was updated I don't think you can automatically "triggered" by a change to database in Access. What you have to do is to check the updated time of the table manually. Try this. For Each obj in Application.AllTables Debug.Print obj.DateModified Next 2. Sending Emails Have you ever consider using automation and control Outlook to send email for you Hope this can help. I know you can do this in SQL Server, in MS Access you could probably u ...Show All
R. John cyberin
Do you know how I can create a dinamic table on visual basic I have a dinamic table in excel that agroup project, sub category project and month, and later fill the budget in this, I need realy create this in visual basic, thanks for your help ...Show All
Le Tigre Ideas for storing results from multiselect listbox
I need to store the results from listbox where the user may make multiple selections, any suggestions Hi I would use an array, which you can redim to fit the number of selected items, or if you are more adventurous try using a collection. Hi Did not realise that you longer term storage, I was thing of short terms storage for VBA use. If possible us Access to store your data. Access can be used from any office app in VBA. You can also use an Excel sheet and use AODB to access it as a table; I am sure Derek Smyth replied to a post with an example of doing this in this forum. The results will need to be stored in a table. ...Show All
i3baid How to use data from inputbox
I am using the following macro in MS Word to get data from the user via an InputBox. How can I tehn deposit the contents of the variable "fname" into a form field on the parent document <code> Sub Getinput() Dim fname fname = InputBox(Enter your name" End Sub </code> I tried using the name of the form field (text10) and adding this line: text10=fname and text10.text=fname to no avail. I'm sure this must be something simple but alas I am a novice. Help ! This should do it: Sub addData() ThisDocument.FormFields("Text1").Result = InputBox("Enter Name") End Sub ChasAA Hi Jim, The rea ...Show All
LotusExigeS1 String Functions
Does anyone know if there's a string function that removes new lines from a string (where return has been hit to start a new paragraph) It's kind of like the Trim functions I'm looking for, but these only work with trailing spaces, not where a new line has been started. Cheers! Keith Your right. I didn't pay attention to on what forum it was:) nae bother big yin. :) Hi, I unmarked CetinBasoz post as the answer as the code given is VB.NET and not VBA. Hi Keith Below example is one option to remove carriage returns (replacing with a space). Just change it to a function and pass your string to it as a parameter Public Sub mysub() ...Show All
GinaK How to loop a macro every 20 minutes
Hello, I need assistance with some code that will run this macro every 20 minutes in an Excel workbook that is constantly open. I think it needs to loop somehow but it is beyond my programming skills. If anyone can point me to the right Method I would greatly appreciate it!! Michael Nice one ChasAA. The other option is to send the process to sleep for 20 minutes using the Windows API. http://mech.math.msu.su/~vfnik/WinApi/s/sleep.html Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Sleep 2000 ' 2000 milliseconds = 2 seconds to delay It might not be the solution your looking for it reallt depends on what you have in mind. Hello Michael, Play around with the following a ...Show All
RickHan whats wrong with this code?
Sub HideGroupBox() If Cells(1, "I").Value = "2" Then DayBox.Visible = False Else DayBox.Visible = True End If End Sub im trying to hide a group box with options if the value in L1 = 2 but in not sure what im doing wrong Hello, try this Sub HideGroupBox() If Cells(1, "I").Value = "2" Then msgbox "hello" DayBox.Visible = False Else msgbox "hello else" DayBox.Visible = True End If msgbox "end" End Sub If it doesn't print "hello" or "hello else", there is a problem to your comparison statement. If is doesn't print "end", but print either "hello" or "hello else", that means there is ...Show All
Luca Beretta ADO Recordsets
I have a routine in Excel, which pulls data in from a SQL Server database into two ADO Recordsets using two seperate queries. These recordsets contain only 1 field, being customer ID, each with in excess of 65,000 records. I need to compare these two recordsets to establish how many customer IDs are present in one, but not the other and vice versa. Is there some clever way of looping I could use to achieve this The only other thing I can think of is a local query within my module on the two datasets, but is this possible Cheers for any help! Keith Derek Smyth wrote: There is no way to run a query over your two recordsets because there needs to be a relationship between the da ...Show All
