Automatically copying contents of cell

Robert E Lee

Active Member
Joined
Aug 10, 2005
Messages
266
Hi all

I would like to be able to copy a cell to a particular range of cells in the same row based on its contents, specifically, if Column B contains the word "void" I would like the next 15 cells in that row to contain the same word.

I know that this can be done pretty simply using VBA, but would like to avoid this approach. I wondered if there was an element in conditional formatting that would enable me to define the word "void" as a pattern but can't see such an option

thanks

Robert
 
But I just realized that when the data is refreshed using the "Refresh" or "Refresh All" it highlights all rows, so this may not be a good option after all. It doesn't do it if I use the "Refresh" button under "Connections" though, so is there a way to disable the other refresh functions, and put a "button" on the menu that effectively goes through the steps of opening "Connections" and selecting the "Refresh" button there?
How is the 'Refresh' achieved in normal circumstances? Is it via a macro or is it manual?

If it is manual, perhaps you could turn it into a macro (macro recorder should give you some starting code if needed) then use something like this:

<font face=Courier New><br><SPAN style="color:#00007F">Sub</SPAN> MacroToRefreshData()<br>    <SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">GoTo</SPAN> PreExit<br>    Application.EnableEvents = <SPAN style="color:#00007F">False</SPAN><br>    <br>    <SPAN style="color:#007F00">'Put the code that does the refresh here</SPAN><br>    <br>PreExit:<br>    Application.EnableEvents = <SPAN style="color:#00007F">True</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>

Turning 'EnableEvents' off while the refresh is done should stop everything being coloured during the refresh.


Another possible approach:
If the refresh updates values in other columns as well as column I then you could try using the existing code but change
Code:
If Not IChanged Is Nothing Then
to
Code:
If IChanged.Address = Target.Address Then
So the main code that transfers the value to column N and colours the row should only get actioned if the change to the sheet is confined to column I only.
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Thanks Peter. . .the second option of limiting it to edits that occur in column "I" works perfectly for my situation.
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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