Method 'Range' of Object _Global Failed

Dobin1s

New Member
Joined
May 18, 2016
Messages
8
Hi ive been trying to tweek an existing code but im getting this error when i run it.

I've got a macro to copy info from one spreadsheet to another which worked fine until now. Im trying to add a section that also changes the colour of a cell when it moves the info across but this seems to be where its getting stuck.

Any Advice?

Windows(TOSS).Activate
Range("A" & TOLINE).Select
Range("A" & TOLINE).Value = strMPAN
Application.EnableEvents = True
Range("B" & TOLINE).Value = strAgentCombo
Application.EnableEvents = False
Range("C" & TOLINE).Value = strNAME
Range("D" & TOLINE).Value = CDate(strCoMCDate)
Range("F" & TOLINE).Value = strCTWC
Range("G" & TOLINE).Value = strInherited
Range("E" & TOLINE).Value = Format(Date, "dd/mm/yy")
Range("A : TOLINE").Interior.Color = RGB(153, 153, 255)<<<<this is="" where="" im="" getting="" stuck.

Thanks in advance :)</this>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Rich (BB code):
Windows(TOSS).Activate
Range("A" & TOLINE).Select
Range("A" & TOLINE).Value = strMPAN
Application.EnableEvents = True 
Range("B" & TOLINE).Value = strAgentCombo
Application.EnableEvents = False
Range("C" & TOLINE).Value = strNAME
Range("D" & TOLINE).Value = CDate(strCoMCDate)
Range("F" & TOLINE).Value = strCTWC
Range("G" & TOLINE).Value = strInherited
Range("E" & TOLINE).Value = Format(Date, "dd/mm/yy") 
Range("A : TOLINE").Interior.Color = RGB(153, 153, 255)

Maybe:

Rich (BB code):
Range("A" & TOLINE).Interior.Color = RGB(153, 153, 255)

WBD
 
Upvote 0

Forum statistics

Threads
1,215,337
Messages
6,124,340
Members
449,155
Latest member
ravioli44

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