Writing VBA for Inserting Text in a multiple cells.

sirmacademy

New Member
Joined
Aug 12, 2018
Messages
17
I want to insert in a cell a text "Saturday" and "Sunday" but I find it difficult to find the pattern inserting it.

Thank you for your help.
 
Hi Jackdanice and Rcik, thank you very much for the code. But the code is running #value for the empty cell. Hoping you may give me another way of leaving it empty if its empty cell or no data. Thank you in advance.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi Jackdanice and Rcik, thank you very much for the code. But the code is running #value for the empty cell. Hoping you may give me another way of leaving it empty if its empty cell or no data. Thank you in advance.

The second macro (named M3) that I posted in Message #9 did not work correctly for you when there were blanks???
 
Last edited:
Upvote 0
Sir Rick the M3 works, but it moves and add the column to the right.
Okay, so now I think we are back to my original confusion over your use of the word "insert". What is being inserted where?

Also, in what you wrote above... what exactly do you mean by "it moves"? What moved?

And what do you mean by it "add the column to the right"? The output from M3 went into Column C... you said in Message #3 "I want to insert in C3, C9 C10, C16 C17, C23 C24, C30 C31" (although you did not explain what you meant by "insert") so what was wrong with where I outputted my Saturday/Sunday text values.
 
Upvote 0
Sir Rick this is the sample format:
ABCD
Dateam inam out
2016-02-0307:3012:30
2016-02-0407:4512:33
2016-02-0508:4012:14

<tbody>
</tbody>








After the M3()

Sir Rick this is the sample format:
ABCDE
Dateam inam out
2016-02-03Saturday07:3012:30
2016-02-0407:4512:33
2016-02-0508:4012:14

<tbody>
</tbody>








May you help me again in solving this problem. I want it this way.
ABCDE
Dateam inam out
2016-02-03Saturday
2016-02-04Sunday
2016-02-0508:4012:14

<tbody>
</tbody>









Only Saturday and Sunday. No time after OUT
PS: Thank you Sir for the unending patience and help.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,644
Members
449,461
Latest member
kokoanutt

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