Hopefully and easy question

Learner99

New Member
Joined
Apr 7, 2014
Messages
21
Hi Everyone,
I'm doing alot of processing on Sheet1 and putting the output on Sheet2.
Can you tell me how to change my code so it will write out to "Sheet2" without flipping back and forth from "Sheet2" to "Sheet1"

Here is my code:

Sub Grid_Dates()
'
' Grid_Dates Macro
'
'
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:AE1"), Type:=xlFillDefault

Range("B2").Select
Selection.NumberFormat = "dddd"
Selection.AutoFill Destination:=Range("B2:AE2"), Type:=xlFillDefault
Cells.EntireColumn.AutoFit
Range("B2").Select

End Sub
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hello

Can you please provide a meaningful topic title?

Also, can you please use
Code:
 tags when you paste code on the forum?Code tags format the code making it easier to read and hence follow the logic of the code.


You can use [CODE] tags in this way: 


Add the word [color=blue][b][code][/B][/color] before the first line of code, and
add the word [color=blue][b][/ code] (without space)[/B][/color] after the last line of code.


Or: you could use the "#" icon when changing / composing a message in the Advanced editing screen.


Thanks for your consideration.
 
Upvote 0
Regarding the topic, a suggestion:

Code:
Sub Grid_Dates()

    Range("B1:AE1").FillRight
    With Range("B2")
        .NumberFormat = "dddd"
        .Resize(, 30).FillRight
    End With
    ActiveSheet.UsedRange.Columns.AutoFit

End Sub
 
Upvote 0
Thanks wigi for the feedback. I'm new to this and didnt know the propper method.

I looked over your feedback and have some questions.
Can you tell me how to add in the following commands to your code.

I'm moving a date to Sheet1 and need to incriment it.

Code:
Selection.AutoFill Destination:=Range("B1:AE1"), Type:=xlFillDefault

Thanks
 
Upvote 0
That's what the first line in y code does: fill cells to the right.
 
Upvote 0
When I run the code I get this
3/27/2014 3/27/2014 3/27/2014

What Im looking for is this
3/27/2014 3/28/2014 3/29/2014

Sorry I may not have been clear in my explanation
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,595
Members
452,657
Latest member
giadungthienduyen

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