help please

madmat252

New Member
Joined
Jan 5, 2010
Messages
10
i have 3 blocks of data each consisting of 4 colums f,g,h,i and rows down on sheet 3 and a list of short codes in a drop down box on sheet 1 what i need to happen is when i select fs1 from the drop dowm list and push a comand button then data from the first block is inputed into a different block of cells a have tried this code but i cant get it to work.

Sub Macro4()
'
' Macro4 Macro
'
'

If Range("A46" = FS1) Then
Sheets("Configuration Data").Select
Range("F3:I9").Select
Selection.Copy
Range("A20").Select
ActiveSheet.Paste
Sheets("Input Data (2)").Select
End If

End Sub
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
try

Code:
If Range("A46" = "FS1") Then
    Sheets("Configuration Data").Range("F3:I9").Copy Range("A20")
End If
I think it just needed the "" around "FS1", but there's no need for all that 'select' malarky.

If you go this way, you may need to explicitly state the destination sheet for range("A20") as in
Code:
Sheets("Configuration Data").Range("F3:I9").Copy sheets("destination").Range("A20")
 
Upvote 0
that didnt work:confused: probably something really simple but i have sat here for hours trying to get it to work now.
 
Upvote 0
Hmm, not sure which sheets your data is coming from or going to for a start. One thing I do know is that "FS1" should have quotes around it.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

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