Hi all,
Using Excel 365.
My code returns an error when the source Table has 1 Row.
How can I modify to handle whether the Table has 1 to n Rows?
Works great as-is as long as the Table has 2 or more rows.
Thanks
-w
Private Sub UserForm_Initialize()
'Objects
Dim wb As Workbook...
Hey!
Goal:
I have two workbooks open, the code sends information from one workbook to the other.
Dim tbSendTo As ListObject
Set tbSendTo = Workbooks(wbName_SendTo).Worksheets(wsName_SendTo).ListObjects(tbName_SendTo)
tbSendTo.DataBodyRange(Row, colInput) = returnValue
Problem:
The code is...
In the past I've done .Range.NumberFormat no issue, but having a problem using with .DataBodyRange . The following is what I have (with generic labeling):
'Code defining variables, etc
with ws.listobjects(1)
.DataBodyRange(r,c).NumberFormat = "0" 'Type Mismatch Error occurs
end with...
I have a macro that I want it to look at a table and if there is data in the table then I want it to complete a VLookup but if there is no data in the table then I want it to end the if statement and move to the next statement (there are 3 tables in total the macro moves through). It is always...
I need to format ALL the cells in a filtered table (even the hidden ones).
I have tried
Sub test()
Dim myRange As Range
Set myRange = Sheets(1).ListObjects(1).DataBodyRange
myRange.WrapText = True
End Sub
Can anyone please help?
Hello gurus,
I've run across a problem that crops up when the filtering of a table produces no results. I am using VBA to filter the table and then copy the DataBodyRange and that works perfectly as long as there are items returned. However, when there are no results in the DataBodyRange (No...
Hi
tbl is one dimensional table with header. I want to get what index it has in table (dataBodyRange)
tbl.DataBodyRange.Find(textToFine).row - gives me row nr in worksheet. If table is in top row, I can simply subtract 1, yet I assume there is a way to get that value without math operations...
Hi All,
I've the below code which does the trick but I get a runtime error 91 on the last line starting with "tbl" . I've used on error resume and it will happily work, but this is ofcourse not the answer. I believe the error lies in the fact that the data body range will be empty following the...
I'm using a query to dynamically populate a defined table in Excel. I'm trying to re-size the table to the last non-blank row, without success. I'm getting stuck on detecting the non-blank row. Here's what I've tried (two different approaches), both find the last row the table is set to, which...
I'd like to clear specific columns in an Excel Table (in VBA). Currently using v2013.
.ClearContents will clear the entire table. I want to retain field names in the left-most column.
Is there a way to detect the the end of the table like a uBound() on an array and perhaps loop to clear...
Hello mr excel,
I have made a fairly small data entry program in excel VBA. It runs very well, but now there is need to have simultaneous dual data entry...scary stuff in excel I know! To get around having two users on one workbook at the same time, I'm simply going to duplicate the original...
Hello,
I am working on a To-Do list in Excel 2010. I am running into a paste range class invalid error. I am relatively new to VBA working off macros and google.
The part I am having trouble with is moving the completed tasks to another table in the sheet, the code I currently have is...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.