Last used column

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
I need "Last used column" in code. Example, last column used is AI, so AI column number in i variable
 
Re: Lat used column

can i get any suggestion on this..
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
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Re: Lat used column

Extremely apologies for my action..
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


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
 
Last edited:
Upvote 0
Re: Lat used column

I do not understand what this means:
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
 
Upvote 0
Re: Lat used column

I purposefully do my post no #10 . The reason coz, those who see my post #8 and started working at their end to provide me solution, will highlight them with new query i posted..
This is i want to say..
I do not understand what this means:
 
Upvote 0
Re: Lat used column

Code:
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
I'm getting an error on red line, could you suggest me what is the problem..
 
Upvote 0
Re: Lat used column

Just to inform, I got the answer..I remove worksheets..
 
Upvote 0

Forum statistics

Threads
1,223,670
Messages
6,173,722
Members
452,528
Latest member
ThomasE

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