Hi all, Can excel paste details from one worksheet to a specific row within another worksheet ( row number is the result of using the match command ) so it can be used to modify a particular row?, if so, can anybody help with a VBA example please?
Hi all, Can excel paste details from one worksheet to a specific row within another worksheet ( row number is the result of using the match command ) so it can be used to modify a particular row?, if so, can anybody help with a VBA example please?
What are you matching.
Use either the VBA Find method or Match to get the Row number
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Hi royUK, I have used the match & row() to find the row number of what I am looking for but want to create another worksheet that looks up the details on that row found, and if I add some details want some VBA to tell excel to paste the information at that row number instead of having to look for the details on a specific row manually.
Im trying to paste data from sheet1 into sheet2 based on a specific row number that I get as a result of using the match command. How can I make excel paste automatically into the specific row in sheet2.
A lot of this will need to be changed to meet your situation, but the syntax for the destination will put whatever is copied to the matching range starting at Sheet2, row rowNumber, column 1.![]()
Dim rowNumber as Long, matchRange as Range rowNumber=Application.Match("x",matchRange,0) Sheets("Sheet1").Range("a2:e2").Copy Destination:=Sheets("Sheet2").Cells(rowNumber,1)
Thank you for your help, will keep you informed.
Hi there, I seem to have difficulty is using your code, It is giving a compile error and must admit im still new to VBA. In sheet 1, is where I search from the daya in sheet 2 using match - so this gives me say row 20.
Now I have the details from row 20 displayed in sheet 1, I modify that info and have a button I can link to your VBA to make it copy from sheet 1 back to sheet 2 row 20.
Any help is much appreciated.
Im trying to modify cells within an existing database and am using the match & index commands to find and display results from a specific row, say row 30, how could VBA be used to copy some cells from one sheet to the database sheet at the given row number of 30 or which ever row number the match command comes up with?
Hi
Set a variable to your found row number
I've just set it to 30, but you would use whatever process to do that.![]()
myrow = 30
You can then use the cells command to determine the output cell
In this case I have set the value in A30 to be the same as A1.![]()
cells(myrow,1).value = range("A1").value
Bit hard to be more specific unless you give more detail on your structure, what you want to take from where, and where you want to put it.
rylo
Hi there, I have attached a very small zip file that has a working version of what I am trying to do - it explains where I am trying to copy to and from.
Although I am OK at worksheet formula's, VBA is still mind boggling and need all the help I can get, so would appreciate as much help you can provide me.
Is it possible to write within the macro lines that I can edit to make the places it pastes to different, i.e the example refers to Sheet2 but my actual database may be DBase1 or DBase2 etc.
Thanks
Sorry, this version of match & index works - sorry if anybody downloaded previous version.
Hi
Try this. Your row isn't really the row of the item, but the position in the defined range. I've added 3 to the result based on your layout.
rylo
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks