Help please....

ExcelNovice

Well-known Member
Joined
May 12, 2002
Messages
583
My spreadsheet starts in B7 and extends to G98. Cell G contains different models of cars (Accord, Civic, Insight, Pilot etc). I was to copy data from this spreadsheet to another spreadsheet based on the value in cell G.
Example: I want to copy the data in columns B, C, D & F from the spreadsheet named Repairnov to another spreadsheet called Hondabrand based on what is written in column G. Any help will be appreciated....Thanks.[/b]
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hello, ExcelNovice,

do you mean this
copy all data in columns B, C, D & F which have a certain text in column G ?

then
autofilter column G to desired value
copy your range
paste on other location
only the visible rows will be pasted

kind regards,
Erik
 
Upvote 0
Erik:

I sorta picked up on this and started something a bit different.
I see Column G values as Unique and Wish to Copy the
data from Col B,C,D and F (same row) by using double-click
event on say G12 9 Thereby copying B12, C12, D12 and F12
to Sheet HondaBrand Cell B10.
Only problem is I can't get it working. Could you show code
that you would use to do so?
Tks in advance,
Jim
 
Upvote 0
Thanks both.

Jim, that's exactly what I'm trying to do.

Erik, if you can provide a code to do this it would be appreciated. I'm trying to do what Jim outlined.
 
Upvote 0
Thereby copying B12, C12, D12 and F12
to Sheet HondaBrand Cell B10.
you cannot copy 4 cells to one unless you concatenate them
I suppose that's not what you want
this code will copy the cells to the same range on sheet "HondaBrand", but I'm quite sure this is not what you want
please clarify
Code:
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim ColArray As Variant
Dim I As Integer
Dim TR As Long

Const WatchCol = "G"
ColArray = Array("B", "C", "D", "F")

If Intersect(Target, Range(WatchCol & 1).EntireColumn) Is Nothing Then Exit Sub
Cancel = True

TR = Target.Row

For I = LBound(ColArray) To UBound(ColArray)
Range(ColArray(I) & TR).Copy Sheets("HondaBrand").Range(ColArray(I) & TR)
Next

End Sub

kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,214,959
Messages
6,122,476
Members
449,087
Latest member
RExcelSearch

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