Copy and paste to right spot in a table

SueKi

New Member
Joined
Feb 15, 2022
Messages
44
Office Version
  1. 365
Platform
  1. Windows
I've built a model to help me set production scenarios on a number of items. As I finalize the inputs for each item - number of machines, target inventories, etc - I'd like to copy the results to another page that has the list of items. I think I could figure out how to add it the bottom a list, but how do I tell it to look the item up in column A and paste it X columns to the right?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
OMG! I think I got it!!!! (excuse the newbie excitement) I need to add more lines of copy/paste, but this one worked!!!!

This is without the offset, but that was something I thought I was going to have to do, but I'm just as happy to tell it what column to paste in.

VBA Code:
Sub Macro1()
'
' Macro1 Macro
'  
Dim greige As String
Dim TRow As Long
 
'Hold greige number to find where to paste
greige = Worksheets("Model").Range("B3").Value
   
'Find what row the greige is on in "Summary Data Run Rates" for pasting
TRow = Application.WorksheetFunction.Match(greige, Worksheets("Summary Data Run Rates").Range("c1:c200"), 0)

'Make sure you dind't forget to add type and notes

  Dim answer As Integer
  answer = MsgBox("Did you add item type and notes?", vbQuestion + vbYesNo)
 
  If answer = vbNo Then Exit Sub

'Copy / Paste

Worksheets("Summary Data Run Rates").Range("BV" & TRow) = Worksheets("Model").Range("E10").Value

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,824
Messages
6,127,077
Members
449,358
Latest member
Snowinx

We've detected that you are using an adblocker.

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.
Go back
Back
Top