Macro Not Working

Kevinax

New Member
Joined
Mar 29, 2010
Messages
25
I wrote simple macro, saved it to "This Workbook", then saved the file to a network directory. The macro works perfectly fine for me and for a co-worker but not for a 3rd co-worker.

What could cause this?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
3rd co-worker has macros disabled?

Is it doing nothing or doing something wrong?

More information helps otherwise all we can do is guess.
 
Upvote 0
The macro simply copies the cotent of the cell on the right. If run in cell A1 it copies the contents from cell B1 without copying the formating (i.e. paste values).

For the 3rd co-worker, the macro copies the content of the cell but it also brings over the formatting as well.

note: we're all using Excel 2010
 
Upvote 0
Can you post the code? I know it seems simple but I had to get somebody to post code the other day and then we found his typo
 
Upvote 0
Sub FillLeft()
'
' FillLeft Macro
'
' Keyboard Shortcut: Ctrl+l
'
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
 
Upvote 0
are you sure that the target cell is not already formatted?
 
Upvote 0
Sorry, I'm not clear which is the target cell.

Cell B1 contains data and is shaded in green. Cell A1 is shaded in blue.

When the macro is run in cell A1, the data in cell B1 should be copied but cell A1 should continue to be shaded in blue.
 
Upvote 0
If you just want to copy the value in the cell to the right, why not do the following:

Code:
Sub Fill_Left()
ActiveCell = ActiveCell.Offset(, 1).Value
End Sub
 
Upvote 0
Any idea why my macro works properly for some people but not others (i.e. it brings over the cell contents and the formatting)?
 
Upvote 0
I don't see any reason that your code should copy the formatting. The only thing that is a little odd is that the value you used for the operation is not the right constant. Rather than xlNone it probably should be xlPasteSpecialOperationNone. I don't see why this would make a difference in the formatting or why it would make a difference on only 1 computer.

I was just thinking... Is there something in the options to automatically match formats that may be checked on 1 computer and not on the others? I took a quick look at the options but I don't see anything. But I know that with 2010 when I add things in a field adjacent to a table it tries to make it part of the table and extends the formatting.

however if you just want to copy one value, copy/paste is inefficient. hal's code is much better and won't go through any type of formatting check.
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,593
Members
449,038
Latest member
Arbind kumar

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