read value from a cell

Philip00

New Member
Joined
Aug 16, 2017
Messages
37
Hi all,

I would like to ask how to refer a cell an read a value from there.

Selection.Resize(4).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

I want that resize number refer to a cell and read that.

For example in "BW5" cell there is a number (let's says 5)

How should i refer that

Selection.Resize("BW5").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove ?

Thank you so much in Advance,
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi, try like this:

Rich (BB code):
Selection.Resize(Range("BW5").Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
 
Upvote 0
Hi, try like this:

Rich (BB code):
Selection.Resize(Range("BW5").Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

Thank you so much it works.

Can you help me also to do it with active cell?

I tried something like this but it gives me error

Selection.Resize(Range(ActiveCell.Address).Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

Thanks in Advance
 
Upvote 0
I tried something like this but it gives me error

Selection.Resize(Range(ActiveCell.Address).Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

This is probably a little better:

Code:
Selection.Resize(ActiveCell.Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

You didn't say what the error was so it's difficult to comment directly on what might be the cause.
 
Upvote 0
This is probably a little better:

Code:
Selection.Resize(ActiveCell.Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

You didn't say what the error was so it's difficult to comment directly on what might be the cause.

Thanks but it is error again

"run-time error '1004':

Application-defined or object-defined error
"Selection.Resize(ActiveCell.Value).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove"

:(
 
Upvote 0

Forum statistics

Threads
1,215,381
Messages
6,124,614
Members
449,175
Latest member
Anniewonder

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