VBA Macro to paste the values with row and column alignment automatically.

Status
Not open for further replies.

Sathish G

New Member
Joined
Aug 16, 2017
Messages
44
Office Version
  1. 2013
Platform
  1. Windows
HI Everyone,

I need a macro to align my results in same sheet according to last maximum used rows from multiple columns.

I have given image link that how am expecting result that will give exact idea.

Please check and do the needful your support will be very helpful for me.

Image link given below.

https://ibb.co/vcQTVQB----> Actual result.
https://ibb.co/pzkvcHB----> expected result



Here is my current code.

Code:
Sheets("Sheet1").Select
Columns("AA:AA").Select
Selection.AutoFilter
ActiveSheet.Range("$AA$1:$AA$200000").AutoFilter Field:=1, Criteria1:= _
"=< fruit**", operator:="xlAnd
Range(" aa2").select
   Range(Selection, Selection.End(xlDown)).Select
Selection.Font.Bold = True
With Selection.Font
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.799981688894314
End With
Selection.AutoFilter
Columns("AA:AA").Select
Selection.AutoFilter
ActiveSheet.Range("$AA$1:$AA$200000").AutoFilter Field:=1, Criteria1:= _
"=**", Operator:=xlAnd
Range("AA2").Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Font
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0
End With
Selection.AutoFilter
Columns("AA:AA").Select
Selection.AutoFilter
ActiveSheet.Range("$AA$1:$AA$200000").AutoFilter Field:=1, Criteria1:=RGB(68, 114, 196), Operator:=xlFilterFontColor
Range("AA2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial
Sheets("Sheet1").Select
Selection.AutoFilter
Columns("AA:AA").Select
With Selection.Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
 
Last edited by a moderator:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Status
Not open for further replies.

Forum statistics

Threads
1,223,722
Messages
6,174,103
Members
452,544
Latest member
aush

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