View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default Code with hidden flaw ERROR 400

This code...

Set CpyRngFrm = Application.InputBox(Prompt:="Enter a Copy FROM
Range.", _
Title:="Enter Copy FROM Range", Type:=8)
If CpyRngFrm Is Nothing Then Exit Sub


..sets a fully qualified ref to the source range. (I'd name it
rngSource) It should also hold a ref to the workbook it belongs to, and
the sheet where the selection was made.



So it should look like this for the inputbox's...

Dim rngSource as Range
Dim rngTarget as Range

Set rngSource = Application.InputBox(Prompt:="Enter a Copy FROM Range.", _
Title:="Enter Copy FROM Range", Type:=8)
If CpyRngFrm Is Nothing Then Exit Sub


Set rngTarget = Application.InputBox(Prompt:="Enter a Copy TOO Range.", _
Title:="Enter Copy TOO Range", Type:=8)
If CpyRngTo Is Nothing Then Exit Sub

And this is for clarity of whats happening and future maintenance?
I still need to adjust something in the code to get to work, right?

I tried Ron's suggestions and trying to digest and try yours also... falling flat on my face.

Howard