ActiveCell.value does not display anything

pwr1965

New Member
Joined
Aug 25, 2022
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I have a number of values, originating from a given worksheet, that need to be displayed on another worksheet. This works great for most values with the following code:

Sheets("Invulblad").Select
Range("M4").Select
Selection.End(xlDown).Select
Sheets(Sheets.Count).Range("B13") = ActiveCell.Value

Here's the problem: it does not work if the active cell contains a formula. On the source worksheet I can see the formula result, but VBA does not copy the resulting value to its destination. Ideas anyone?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi & welcome to MrExcel.
That code works for me & copies the result of the formula, what is it doing for you?
 
Upvote 0
Welcome to the Board!

You should be able to reduce all your code above down to this one line:
VBA Code:
Sheets(Sheets.Count).Range("B13").Value = Sheets("Invulblad").Range("M4").End(xlDown).Value
 
Upvote 0
Hi & welcome to MrExcel.
That code works for me & copies the result of the formula, what is it doing for you?
Hi Fluff,
Thanks for your swift response. What it does for me is exactly nothing; it returns an empty cell.
Not for source cells that contain text( these work just fine), but for source cells that contain a formula. I have cells that perform a VLOOKUP based on input and I want to use these VLOOKUP results in my final sheet.
 
Upvote 0
Are you sure that the formula in the active cell is not returning ""?
 
Upvote 0
Welcome to the Board!

You should be able to reduce all your code above down to this one line:
VBA Code:
Sheets(Sheets.Count).Range("B13").Value = Sheets("Invulblad").Range("M4").End(xlDown).Value
Hi Joe4,
Thanks a million, this makes my code a lot leaner. Alas, it did not solve my initial problem: all source cells containing formulas result in empty destination cells..
 
Upvote 0
Are you sure that the formula in the active cell is not returning ""?
Positive. The sheet called "Invulblad" shows the desired result, but this is not carried over to the new sheet.
 
Upvote 0
Do you have formulae in col M that return "", especially if the formula is copied down further than needed?
 
Upvote 0
In that case using
VBA Code:
Range("M4").Select
   Selection.End(xlDown).Select
Will take you the very last row in col M that has a formula & it's probably returning ""
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,592
Members
449,174
Latest member
chandan4057

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