Need to return a cell's value from a cell that changes number of rows each day

johnsvikings

New Member
Joined
Dec 3, 2018
Messages
8
I am in need of the VBA code for the following:
1. I am starting in cell B3 on worksheet "Mapped_Totals"
2. I need to retrieve the last cell value in column B on worksheet "Baltimore". This column has 3 blank cells then a header column labeled "0-30 days" and then the data flows after that (each new daily report may have a different number of rows/customers listed and I only need the total for that column B on worksheet "Baltimore") and put it back in cell B3 on worksheet "Mapped_Totals"
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi & welcome to MrExcel.
How about
Code:
   Sheets("Mapped_Totals").Range("B3").Value = Sheets("Baltimore").Range("B" & Rows.Count).End(xlUp).Value
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
What if the cell value is a text like ("37 customers") and I only want to retrieve all characters from the left minus the 1st ten (would leave off " customers"?
 
Upvote 0
If you want everything before the first space try
Code:
With Sheets("Baltimore").Range("B" & Rows.Count).End(xlUp)
   Sheets("Mapped_Totals").Range("B3").Value = Left(.Value, InStr(1, .Value, " ") - 1)
End With
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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