This code below says Run Time error 13??
Set QDetails = Body_And_Vehicle_Type_Form.Quote_Details
This code below says Run Time error 13??
Set QDetails = Body_And_Vehicle_Type_Form.Quote_Details
Trying to find a value in source sheet data column then copy a range to dest sheet data & paste the range to destination worksheet offset 1 column over.
It can`t find the Value Electric in both sheets by the looks?
And it seems to not like 2 Finds in the same code?
Is that right? if so how can you overcome it?
I`ve asked MrExcel but no reply today
Copy from a worksheet | MrExcel Message Board
Sub Tippa_Electric_Wires()
Dim wsSource As Worksheet, wsDest As Worksheet
Dim QDetails As ComboBox
Dim i As Long, rng As Long
Dim Addme As Range, RngSource As Range, RngDest As Range
Set wsSource = ThisWorkbook.Worksheets("Part_Group_Items_ List")
Set wsDest = ThisWorkbook.Worksheets("Job Card Master")
Set QDetails = Body_And_Vehicle_Type_Form.Quote_Details
With wsSource.Range("D:D")
Set RngSource = .Find("ELECTRICS", , xlValues, xlPart)
End With
With wsDest
Set RngDest = .Find("ELECTRICS", , xlValues, xlPart)
Set Addme = RngDest.Offset(0, 5)
End With
For i = 0 To QDetails.ListCount - 1
If QDetails.Selected(i) Then
If QDetails_Details.List(i, 1) = ("Boxer") & "" & QDetails_Details.List(i, 4) = ("L2") & "" & QDetails_Details.List(i, 2) = ("Single") Then
wsSource.RngSource("A72:O78").Copy Destination:=Addme
End If
End If
End Sub
Display More
Please don`t worry anymore the MrExcel forum has done the trick.
Any luck with this
The rng says below.
: XPath : <The specified range is invalid due to one or more of the following reasons:
•The range refers to cells in more than one column.
•The range contains mapped cells from more than one XML
The code is activated by a Combobox which is why it`s VBA
The code below should replace Transit Value to value from a Combo Box but it replaces the whole-cell values rather than just Transit
I have asked MrExcel but no reply
Range Issue | Page 3 | MrExcel Message Board
Option Explicit
Sub Subframe_Replace()
Dim FirstAddress As String
Dim MyArr As Variant
Dim ws As Worksheet
Dim DRng As Range, rng As Range
Dim x As Long
Dim i As Long
Dim VModel As ComboBox
Set VModel = Body_And_Vehicle_Type_Form.Model_Type
Set ws = ThisWorkbook.Worksheets("Job Card Master")
With ws.UsedRange.Columns("E:F")
Set rng = .Find("Transit", , xlValues, xlPart)
If Not rng Is Nothing Then
FirstAddress = rng.Address
Do
Set DRng = rng
Select Case VModel.Value
Case ("Sprinter")
DRng.Value = "Sprinter"
Case ("Master")
DRng.Value = "Master Movano NV400"
Case ("Movano")
DRng.Value = "Master Movano NV400"
Case ("NV400")
DRng.Value = "Master Movano NV400"
Case ("Boxer")
DRng.Value = "Boxer Ducato Relay"
Case ("Ducato")
DRng.Value = "Boxer Ducato Relay"
Case ("Relay")
DRng.Value = "Boxer Ducato Relay"
End Select
Set rng = .FindNext(rng)
Loop While Not DRng Is Nothing And DRng.Address <> FirstAddress
End If
End With
End Sub
Display More
rcl Says out of con range
I`ve done what you said but can`t work out how to add it to my code?
I have about 50+ of these in my code how can we apply the code to 50+replacments
I`ve now sent a thread
Trying to replace a value in Excel with code but it ends up like the below.
GREENHOUS FLEET SERVICES FLEET SERVICES FLEET SERVICES |
The code is here
.Replace what:="GREENHOUS", replacement:="GREENHOUS FLEET SERVICES"
How could I alter it so it does not repeat itself?
Sorry can`t find out how to post a thread
There is a new thread I would like you to look at if pos?
Thanks also a good idea I`ve done what you said
Ok good plan
Again thanks for all your help
Me pressing Done rather than Month filter.
Sorry it`s working now thanks for your help
Still not working
Got in mind to chat to IT support because your code works on yours but not on my computer?
In other words, the code is right so it must be a problem with my end?
If that makes sense??
That's what I did