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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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