Ok well I thank you anyways...
Ultimately what I am looking for is how to Dim the updated table back into VBA and then how to update the Attribute Block values.
In Excel I believe it is something like...
Dim vAttributeData
vAttributeData = XlSheet.UsedRan ge
But I don't know how to pull a table
Then once it is dimmed, how to match it up for use.
I think I need to match the...
User Profile
Collapse
-
Update code to get modified records from table and send it back to attributes
I am so sorry to resurrect this but I have been looking for a way to expand it.
I've posted my new question in VBA to Populate Table (Update).Leave a comment:
-
VBA to Populate Table (Update)
This question is an extension to that in VBA to populate access table.
I have been looking for a way to expand it to update the block attributes after modifying the TableDef but with no success.
What I am trying to do is, after populating the Attribute Table, run an update query, then send the updated TableDef back to the attributes. I am not sure how to pull it back and then loop it through in order to update the attribute blocks... -
NeoPa
Thank you so much for your help...
BTW I took your advice and used the select case statement and it worked great...
Thanks AgainLeave a comment:
-
Awesome...
I got it to work. It was caught up on the primary key field.
Now if possible how do i clean up the code...Leave a comment:
-
Thank you so much for the reply and the pointers...
As I am not skilled in vba and barely know how to put pieces of code together. I will do some research on this. Just please point me in the right direction. Is it that I need to move the the secton that writes the update in to the existing loop and add something like a "next row +1" to the loop. Or does it need something more?
Thanks again for any poi...Leave a comment:
-
VBA to populate access table
I am completely stuck...
The following code is supposed to get the attribute values from an acad drawing and populate an access table. However it only populates one row and stops.
Is it possible to modify the code so that the array will export all the attribute values to the table?
Any assistance is appreciated
...Code:Sub ExportTitle() ' Open database and
-
Ok so I found a work around...now I am opening the text file and sorting the headers using excel and then importing it with the previous posted code. The spec is now in the same order as the sort. This i believe will stop the missing data on import due to the headers not aligning.
Thanks for you suggestion and answering my questions
...Code:Dim Xl As Excel.Application Dim XlBook As Excel.WorkbookLeave a comment:
-
Ok so I got the insert to work however now I found another issue.
When inserting the tab delimited text file using the following do.cmd command and the headers are in a different order it messes up the import, meaning that the imported data is missing from whatever columns that was in the wrong order. I assume it is because of the specification criteria.
Is there another way to perform the import so as to eliminate...Leave a comment:
-
The tab delimited txt file is created by a selection of attribute symbles in a autocad drawing so the order of the fields will vary each time the selection is made.
A couple of questions...
Will the suggestion work by field names?
How will the data line up if field1 is not the same name as field2?
Does sorting the fields Alphabetically add any value?Leave a comment:
-
VBA to Import Tab Delimited txt file and Reorder the Fields in the table
I am trying to use vba to import a tab delimited txt file where both the file name and the content varies.
I have a form with a button linked to the code, it will import the tab delimited file, update some column data in the table based on a query and then export it back out to the same tab delimited txt file. The issue is when the tab delimited file reorders or changes the header names then the process doesn't work.
... -
-
VBA to Replace "-" to "_" in excel sheet name
I am trying the use VBA to create a named range of each Sheet Name. The problem is the Sheet Names contain a hyphen and I guess that can't be used in a named range.
How can I use VBA to rename or replace the existing portion of the sheet name that contains "-" to "_" -
Think I may have found the answer
Code:InsertPoint = Left(OutputCells.Address(1, 0), InStr(1, OutputCells.Address(1, 0), ":") - 1)
Leave a comment:
-
Ok I am still looking for a way to do this...
I tried the following but it only works on the same worksheet. If the code is ran again on another worksheet it fails.
I also tried this one. It works...Code:address = OutputCells.address(External:=False) address = Left(address, Len(address) - InStr(1, address, ":")) Range(address).Resize(Selection.Rows.Count, 4).SelectLeave a comment:
-
How to get the first row in a range using input prompt
I am trying to figure out how to get the starting row of an application inputbox range so that it could be used as the Insert point to used the ".Insert Shift:=xlDown" to paste the pivot table
...Code:Sub Get_First_Row_in_Range() Dim pt As PivotTable Dim strField As String Dim WSD As Worksheet Dim PTCache As PivotCache Dim PRange As Range Dim LastRow As -
Looks like i figured it out...
I used
instead or the folowing and it seems to workCode:'Get the Sheet name of the outputcells shtname = OutputCells.Parent.Name
...Code:'Get the Sheet name of the outputcells address = OutputCells.address(External:=True) address1 = Right(address, Len(address) - InStr(1, address, "]")) address2 = Left(address1,Leave a comment:
-
Thanks for your comments and help. I will try them both and see which works best for the needLeave a comment:
-
How to get the sheet name from a prompt input
I am trying to get the worksheet name from a prompt input box
The following will work the first time through but not the next. Can someone point me in the right direction
...Code:Sub Getsheetname() Dim address As String Dim address1 As String Dim address2 As String Dim shtname As String 'Show input box to get where they want it paste -
In Excel can VBA be used to make an Array to sum device quanities
In Excel using VBA, how can I sum the following up to device types, quantities and then put the data on a seperate tab in a specific cell range
...Code:Device Qty Amps Device A 1 0.060 Device B 1 0.092 Device A 1 0.060 Device B 1 0.092 Device B 1 0.092 Device C 1 0.025 Device C 1 0.025 Device D 1 0.089 Device A 1 0.060 Device B 1 0.092
No activity results to display
Show More
Leave a comment: