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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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