VBABEGINER
Well-known Member
- Joined
- Jun 15, 2011
- Messages
- 1,284
- Office Version
- 365
- Platform
- Windows
I need "Last used column" in code. Example, last column used is AI, so AI column number in i variable
Please don't start bumping your requests after just 22 minutes... that seems a little too aggressive/impatient, and may scare some people who are helping you away.can i get any suggestion on this..
blr = Range(Range("B5"), Range("B5").End(xlDown)).Rows.Count
Please don't start bumping your requests after just 22 minutes... that seems a little too aggressive/impatient, and may scare some people who are helping you away.
Try this:
Code:blr = Range(Range("B5"), Range("B5").End(xlDown)).Rows.Count
The reason im putting again here, as you said exactly, the one who wants me to work should refer my updated post...
so they will not work on my post no..#8
Sub fnCombine()
Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Combine"
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
If ws.Name = "Atlantic" Or ws.Name = "South" Or ws.Name = "Midwest" Or ws.Name = "Northeast" Or ws.Name = "CA" Or ws.Name = "West" Or ws.Name = "SELECT" Then
ws.Activate
Cells(1, 1).Select
i = Range("A1:A5000").Find("Monthly", Range("A1"), xlValues, xlWhole, xlByColumns, xlNext).Row
x = i + 3
LC = Cells(3, Columns.Count).End(xlToLeft).Column
bLR = Range(Range("B5"), Range("B5").End(xlDown)).Rows.Count
[COLOR=#ff0000] Worksheets(ws).Range(Cells(x, 1), Cells(x + 1, LC)).Select[/COLOR]
Selection.Copy
Worksheets("Combine").Range("A1").PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End If
Next ws
End Sub
All,
Fluff, hiker, MikeG, Joe and "* Answer *"...Thanks guys..Appreciate your reply..