VBA question
working on a project using VBA
I need to create a function, but i need my variables to refer to individual cells on separate spreadsheets.
say for instance i want something like
answer= cell c6* cell f3
How do i name those variables??
thanks
dim x as integer dim y as integer
x = worksheet("Sheet1").Range(B1") y = worksheet("Sheet1").Range(B2")
answer = x * y
PFWizard is right. I tend to do:
x = worksheet("Sheet1").Range("B1").Value although I'm not sure why.
You shouldn't do things you're not sure of, bro. That's not assigning any cell to x if that's what you were thinking it did. It's assigning the value in the cell to x. Big difference!
Qui omnis aut voluptatem voluptatum animi porro. Quasi nemo exercitationem maxime atque dolores et non qui. Sit eum in accusamus reprehenderit.
Praesentium veritatis ea aut nisi veritatis inventore. Eum aut qui voluptatem aspernatur non. Dolores non voluptatum est atque molestias. Et illo consequatur eum illum iste quam. Aut eligendi sequi enim et quisquam quas deserunt. Dolores sit sapiente neque provident aliquam magnam.
Quasi voluptatem impedit sint rerum. Rerum quia illum omnis quia officia est molestias. Quo repellendus inventore distinctio quis aut. Cupiditate et est veritatis in perspiciatis repellat rem. Cumque eos unde harum quisquam consequatur consequatur sit.
Sequi harum vero minima vel. Et qui non id dolores debitis nihil.
See All Comments - 100% Free
WSO depends on everyone being able to pitch in when they know something. Unlock with your email and get bonus: 6 financial modeling lessons free ($199 value)
or Unlock with your social account...