Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there something in vba that will allow me to select a certain amount of
columns by variable? I have a sum that is formulated on sheet1. I need to figure out how to select that many columns starting at b1 on sheet 2. If it matters I need to have 5 rows by ever how many columns. thanks so much for your help! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -- HTH RP (remove nothere from the email address if mailing direct) "Jack" wrote in message ... Is there something in vba that will allow me to select a certain amount of columns by variable? I have a sum that is formulated on sheet1. I need to figure out how to select that many columns starting at b1 on sheet 2. If it matters I need to have 5 rows by ever how many columns. thanks so much for your help! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() myVar =5 Worksheets("Sheet2").Range("B1).Resize(1,myVar).En tireColumn.Select -- HTH RP (remove nothere from the email address if mailing direct) "Jack" wrote in message ... Is there something in vba that will allow me to select a certain amount of columns by variable? I have a sum that is formulated on sheet1. I need to figure out how to select that many columns starting at b1 on sheet 2. If it matters I need to have 5 rows by ever how many columns. thanks so much for your help! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jack,
Sub ColsandRows() Dim i As Integer i = Range("A1").Value Range("B2").Resize(5, i).Select End Sub HTH Regards, Howard "Jack" wrote in message ... Is there something in vba that will allow me to select a certain amount of columns by variable? I have a sum that is formulated on sheet1. I need to figure out how to select that many columns starting at b1 on sheet 2. If it matters I need to have 5 rows by ever how many columns. thanks so much for your help! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jack,
Try: '<<============= Sub Tester02() Dim i As Long i = Sheets("Sheet1").Range("A1").Value '<<==== CHANGE With Sheets("Sheet2") .Activate .Range("B2").Resize(5, i).Select End With End Sub '<<============= Note, however, that it is rarely necessary or desirable to make selections --- Regards, Norman "Jack" wrote in message ... Is there something in vba that will allow me to select a certain amount of columns by variable? I have a sum that is formulated on sheet1. I need to figure out how to select that many columns starting at b1 on sheet 2. If it matters I need to have 5 rows by ever how many columns. thanks so much for your help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select cell by variable name | Excel Discussion (Misc queries) | |||
Use a Variable to select a range | Excel Discussion (Misc queries) | |||
Select Sheet - Variable | Excel Programming | |||
worksheet select using variable | Excel Programming | |||
Select workbook with variable name. | Excel Programming |